git上传异常

上传时卡在这一步:

1
run "git gc" manually. See "git help gc" for more information.

通过文档查到这条命令

文档: https://git-scm.com/docs/git-gc

1
git-gc  - 清理不必要的文件并优化本地存储库

gc 是garbage collection的缩写 ,我的仓库中文件比较多了,以前一直没有清理过,这个错误可能是因为产生垃圾太多

简单指令

1
git gc

仔细检查清理

1
git gc --aggressive

检查仓库,如果情况良好,不执行gc

1
git gc --auto

不要整理任何零散的文件

1
git gc -no-prune