简世博客

一个简单的世界——博客空间,写了一些Android相关的技术文章,和一些点滴的想法

0%

git 同步超大仓库失败的解决办法

git 同步超大仓库的时候,会报如下错误

1
2
3
4
5
6
git fetch
error: git upload-pack: git-pack-objects died with error.iB/s
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

此时使用 git config core.compression -1 对代码进行压缩

或者 git fetch --depth 1 origin remote_branch_name 只同步一个分支,都可以解决该问题。


zsh 在超大工程下可能会性能变差,可以执行 git config --add oh-my-zsh.hide-dirty 1 来优化该问题。