如何在后台查看git gc的进度? [英] How can I view progress of git gc in the background?
问题描述
当我运行 git gc
之类的命令时,会收到如下消息:
When I run a command like git gc
, I get a message like this:
$ git fetch
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
似乎新版本的Git现在正在后台运行自动打包,这是一个不错的功能!如果我手动运行 git gc
,则会收到以下消息:
It seems like newer versions of Git run auto-packing in the background now, which is a nice feature! If I run git gc
manually, I get this message:
$ git gc
fatal: gc is already running on machine 'machinename' pid 14009 (use --force if not)
这很有道理.但是,我很想能够以某种方式查看正在后台运行的 gc
的进度?
This makes sense. However, I would quite like to be able to watch the progress of gc
that is running the background somehow?
很显然,我可以运行 while之类的东西!git gc;睡1s;完成
,但这并不能为我提供像漂亮的Git进度指示器一样多的信息,它还会自动打包一次额外的时间.
Obviously, I could run something like while ! git gc ; do sleep 1s ; done
, but that doesn't give me nearly as much information as a pretty Git progress indicator could, and it runs auto-packing an additional time.
推荐答案
您可以将其配置为非背景,然后我相信它应该报告其进度:
You can configure it to be non-background, then I belive it should report its progress:
git config gc.autoDetach false
这篇关于如何在后台查看git gc的进度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!