git clone失败问题

参考这篇文章

我遇到的问题是,我能够拉下来其他仓库的代码,唯独有一个仓库的代码拉不下来,增加了buffer的空间也没用, 于是我使用了最后的–depth 1设置了拉取的深度为1,即只拉取最近上传的代码。
这样才能拉取成功。
https://blog.csdn.net/u013719138/article/details/89788051
但是后续的切换分支出现问题,即只拉取了最近一次提交,所以当使用git branch -a的时候并没有显示所有的远程分支,也不能进行切换,如果需要切换到远程的其他分支,需要进行如下操作:

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

https://www.jianshu.com/p/1031dd2a6c3a

发布了37 篇原创文章 · 获赞 0 · 访问量 638

猜你喜欢

转载自blog.csdn.net/xionglaine/article/details/104165669