git仓库过太大,导致clone 失败

git clone过大的仓库时会报以下错误

remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header

解决办法是分层clone

$ git clone --depth 1 https://github.com/dogescript...
$ git remote set-branches origin 'remote_branch_name'
$ git fetch --depth 1 origin remote_branch_name
$ git checkout remote_branch_name

参考
https://stackoverflow.com/questions/23708231/git-shallow-clone-clone-depth-misses-remote-branches

,

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享
评论 抢沙发
区块链技术的头像-区块链开发网

昵称

取消
昵称表情代码图片