有的时候无法使用ssh git clone项目,使用http的方式clone方式,但是项目太大,commit信息太多,出现指定分支都clone不下来的情况,可以使用如下命令:
git clone -b 分支 --depth 1 仓库地址
代码拉取下来,这样拉取只会拉取最近的提交,log也只有最近的几条;
然后使用命令:
git config remote.origin.fetch "+refs/heads/:refs/remotes/origin/"
git remote update
就可以将所有的分支全部拉取下来,在AS上直接切换分支即可
版权归原作者 zmybiealex 所有, 如有侵权,请联系我们删除。