根据某个远端存在的分支新建一个本地分支,并切换到这个本地分支

 

从远程仓库中拉一个本地不存在的分支:

git checkout -b 本地分支名  origin/远程分支名

该命令会创建一个本地分支并,并与远程分支关联,并自动切换到这个本地分支。

 

如果出现提示: cannot update paths and switch to branch xx at the same time. Did you intend to checkout origin/xx which can not be resolved as commit?

则需要先执行: git fetch

 

Ref:

https://www.cnblogs.com/hamsterPP/p/6810831.html

posted @ 2019-07-30 20:16  JadeCicada  阅读(567)  评论(0编辑  收藏  举报