如果因为项目过大,clone失败怎么办

2022-10-24  本文已影响0人  今年27

1,可以考虑增加缓存

git config --global http.postBuffer 2048M
git config --global http.maxRequestBuffer 1024M
git config --global core.compression 9

git config --global ssh.postBuffer 2048M
git config --global ssh.maxRequestBuffer 1024M

git config --global pack.windowMemory 256m 
git config --global pack.packSizeLimit 256m

2,如果还不行可以考虑只先clone一部分git历史记录

1. git clone --depth 1 //FORKLOCATION
2.git fetch --unshallow

之后可以通过

$ git remote set-branches origin 'remote_branch_name'
$ git fetch --depth 1 origin remote_branch_name
$ git checkout remote_branch_name

来切换远程分支
参考文档
https://blog.csdn.net/qq_43827595/article/details/104833980

上一篇下一篇

猜你喜欢

热点阅读