1.首先我们要用git branch看一下,当前分支
2.如果分支不是你想要的,那么就切换分支:git checkout -b 想要切换到的分支名称
3.把新建的开发分支push到远端
git push origin 新建的分支名称
4.拉取远端分支
git pull
如果有以下提示:
>git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> feature/V5.0.0-snow
则说明,当前的分支并没有和本地分支关联,根据提示进行下一步:
5.关联
git branch --set-upstream-to=origin/新建分支名称
6.再次拉取代码
git pull