git gc

git gc
有时候当你运行一些git命令(比如git pull)的时候,会有如下提示:

1
2
Auto packing the repository for optimum performance. You may also
run "git gc" manually. See "git help gc" for more information.
  翻译:

1
2
自动包装最佳性能的存储库。
你也可以手动运行 ‘get gc’ 。有关更多信息,请参见“git帮助gc”。

当有这个提示的时候,直接运行 ' git gc ',就可以了。

原因:

Git 往磁盘保存对象时默认使用的格式叫松散对象 (loose object) 格式。Git 时不时地将这些对象打包至一个叫 packfile 的二进制文件以节省空间并提高效率。当仓库中有太多的松散对象则就会提示你运行 ' git gc '。

原文地址:https://www.cnblogs.com/wuyifu/p/5665854.html