Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Git克隆不';没有进展_Windows_Git_Cmd_Progress - Fatal编程技术网

Windows Git克隆不';没有进展

Windows Git克隆不';没有进展,windows,git,cmd,progress,Windows,Git,Cmd,Progress,我正试图获得git clone的进展,但没有成功 我尝试了git clone--progress 2>stderr.txt,但它只返回: Cloning into 'project-name'... done. 我需要的输出类似于: Progress: 1/100 Progress: 2/100 Progress: 3/100 我的git版本是2.21.0.windows.1 编辑: 我正在使用child\u进程从NodeJS调用git clone,代码如下: let cloneSpawn=

我正试图获得git clone的进展,但没有成功

我尝试了git clone--progress 2>stderr.txt,但它只返回:

Cloning into 'project-name'...
done.
我需要的输出类似于:

Progress: 1/100
Progress: 2/100
Progress: 3/100
我的git版本是2.21.0.windows.1

编辑:

我正在使用
child\u进程从NodeJS调用
git clone
,代码如下:

let cloneSpawn=spawn(“git”,“clone”,“progress”,path],{shell:true});
cloneSpawn.stderr.on(“数据”,d=>{
log(d.toString());
});

克隆进度输出到stderr。
--progress
标志强制它发生,即使stderr不是tty设备(如中所示,返回false/0)

不幸的是,
--progress
内部的
git clone
通过调用其他git程序来工作,并且它无法将
--progress
标志传递给这些程序。这些程序执行各自的
isatty()
测试,这表示重定向的stderr不是tty,因此这些程序不会打印任何进度消息


修复这一问题需要修复底层Git bug。如果您选择这样做,解决方法是将
git克隆
连接到满足
isatty
测试的东西:在Linux和类似系统上的伪tty。(我不知道Windows上的诀窍是什么。)

克隆进度被输出到stderr。
--progress
标志强制它发生,即使stderr不是tty设备(如中所示,返回false/0)

不幸的是,
--progress
内部的
git clone
通过调用其他git程序来工作,并且它无法将
--progress
标志传递给这些程序。这些程序执行各自的
isatty()
测试,这表示重定向的stderr不是tty,因此这些程序不会打印任何进度消息


修复这一问题需要修复底层Git bug。如果您选择这样做,解决方法是将
git克隆
连接到满足
isatty
测试的东西:在Linux和类似系统上的伪tty。(我不知道Windows上的诀窍是什么。)

可能是重复的,不是吗work@lucas,你试过哪种答案,你有什么问题吗?@牧师试过--进步旗。监控文件夹大小不是一个选项,因为执行会阻止程序。可能是重复的,但没有work@lucas,你试过哪种答案,你有什么问题吗?@牧师试过--进步旗。监控文件夹大小不是一个选项,因为执行会阻塞程序。我实际上是在从nodejs读取stderr。我用代码更新了主帖。我不知道这在Windows上有什么作用。Unix ish等效于fork和exec,其输出通过管道进行,管道对象不是“tty ish”,因此无法通过isatty()测试。(大约三年前,我编写了一个大型Python程序来维护一组存储库,并希望让它获取进度指示,但遇到了同样的问题。)我实际上是在阅读nodejs的stderr。我用代码更新了主帖。我不知道这在Windows上有什么作用。Unix ish等效于fork和exec,其输出通过管道进行,管道对象不是“tty ish”,因此无法通过isatty()测试。(大约三年前,我编写了一个大型Python程序来维护一堆存储库,并希望让它获取进度指示,但遇到了同样的问题。)