赞
踩
设置clone深度
git clone --depth=1 https://xxxx
用浅拷贝来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
替换https
把http(s)替换成git,即:
git clone git://xxx
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。