是否有导致 git gc --auto
运行的命令的明确列表? git-gc(1) man page简单地说:
--auto
With this option, git gc checks whether any housekeeping is required; if not, it exits without performing any work. Some git commands run
git gc --auto
after performing operations that could create many loose objects.
(强调)
我正在组织一次从 SVN 到 Git 的大规模迁移。绝大多数用户将使用 Windows PC,其中相当一部分是非技术人员。他们将使用 TortoiseGit(因为它与他们已经熟悉的 TortoiseSVN 非常相似)——我注意到 TortoiseGit 根本不包含任何手动运行 git gc
的功能。
不能指望非技术人员必须启动“git bash”命令行才能从适当的工作目录运行 git gc --auto
;并且由于我们使用的是 MsysGit 的“可移植”发行版,因此它们将没有“Git GUI Here..”windows shell 上下文菜单快捷方式。
随着时间的推移,Git 将主要 self 维护是否合理,或者我是否需要尝试制定一种非技术用户友好的方法来调用 git gc --auto
?
最佳答案
builtin/merge.c: const char *argv_gc_auto[] = { "gc", "--auto", NULL };
builtin/receive-pack.c: "gc", "--auto", "--quiet", NULL,
git-am.sh: git gc --auto
git-rebase--interactive.sh: git gc --auto &&
git-svn.perl: command_noisy('gc', '--auto');
来自 git.git 上的 git grep -- --auto
,这些结果看起来很有趣。值得注意的是 builtin/merge.c
,这意味着非常常见的 git pull
应该触发 git gc --auto
。
此外,除非您的“非技术”员工正在做相当“高级”的事情(此时他们将不再是“非技术”),否则我不明白为什么他们需要运行 git gc
手动而不是让 git gc --auto
处理一切。
关于git - 导致 git gc --auto 的所有命令的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5137447/