第一步:切换到被copy分支,并且当前分支必须要保持是最新代码
git checkout 被copy分支
git pull
第二步:从当前分支拉开发分支
git checkout -b 自己的分支名称 如下:
tengxiao.ma@SJ-DN0261 MINGW64 /d/work/git/star/star-txsupport-ser (feature_star-1)
$ git checkout -b feature_star-1_mtx_20200423
Switched to a new branch ‘feature_star-1_mtx_20200423’
第三步:把新建的开发分支push到远端
git push origin 分支名称 如下:
第四步:拉去远端分支
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/新建分支名称
第六步:再次拉去代码
git pull