我一直在阅读有关 git 的资料,但我有一个非常特殊的问题,我很难回答。
什么时候 git gc
会自动执行?
我从各种论坛的小道消息中了解到,它默认发生在推送或获取/pull 时 - 但我找不到任何来源来验证这一点。连the documentation itself只得到这个特定的(强调我的):
Some git commands may automatically run git gc; see the --auto flag below for details
和--auto
标志指定
Some git commands run git gc --auto after performing operations that could create many loose objects.
我希望能够确定地说:
“在运行以下命令之一之前,git 不会清除松散的树和 blob 文件:{这里是神秘列表}。运行这些命令之一时,如果数量松散的对象超过gc.auto
的值,git会自动将对象压缩成packfile。
最佳答案
目前有:
- 获取
- merge
- 是
- 接收包
- 提交(starting with Git 2.17, Q2 2018)
可以通过执行 code search 来验证实际列表.
此外,您还可以看到接收时的 gc 可以使用 receive.autogc
禁用,其他人只是在最后运行 gc。
关于git - git gc 是否以确定的时间间隔执行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40025328/