git - 导致 git gc --auto 的所有命令的列表

标签 git msysgit git-gc

是否有导致 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/

相关文章:

windows - msysgit bash 中的语法错误 =~ 运算符

windows - Egit 在处理大项目时非常慢

git - 如何在 Git 远程存储库上触发垃圾回收?

git - msysgit git-am 无法应用它自己的 git 格式补丁序列

git - "dangling"和 "loose"对象是否相同?

git - 如何在git中检查裸仓库的状态

node.js - 如何通过 git 在部署项目上运行 npm? ( Hook /接收后 : npm: command not found)

GIT:将branch1和branch2 merge 到master中而不覆盖

xcode - 无法从 Xcode Server 托管存储库创建机器人

git - 如何使用 git-svn 处理 IDE 项目文件