当前位置:   article > 正文

git clone速度过慢解决方法_clone 到37%就不动了

clone 到37%就不动了

2019/10/09

在git clone的时候会出现下载速度很慢,甚至卡住不动。这里有几个解决方法。

设置clone深度

git clone --depth=1 https://xxxx
  • 1

用浅拷贝来clone项目,不用clone项目的完整历史,而只需clone最近的一次提交,但是项目里面的文件都会完整地被下载下来。
感谢https://www.jianshu.com/p/fe5612c1bdd0
但是呢,这种方法如果我们用git brunch -a会发现只有一个master。这时候我们可以用以下命令来切换到其他brunch:

git remote set-branches origin '*'
#You can also use git remote set-branches origin '*' for all branches, replace the * with a branchname for one.ex:git remote set-branches origin 'target_brunch_name'

git fetch -v
git checkout target_brunch_name
  • 1
  • 2
  • 3
  • 4
  • 5

替换https
把http(s)替换成git,即:

git clone git://xxx
  • 1

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/787048
推荐阅读
相关标签
  

闽ICP备14008679号