分支 建立

一、 切换到被copy的分支(master),并且从远端拉取最新版本

g i t c h e c k o u t m a s t e r git pull
1
2
二、从当前分支拉copy开发分支

$git checkout -b dev
Switched to a new branch ‘dev’
1
2
三、 把新建的分支push到远端

$git push origin dev
1
四、拉取远端分支

$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

If you wish to set tracking information for this branch you can do so with:

git branch –set-upstream-to=origin/ dev

经过验证,当前的分支并没有和本地分支关联,根据提示进行下一步:
1
2
3
4
5
6
7
8
9
10
11
12
13
五、关联

$git branch –set-upstream-to=origin/dev
1
六、 再次拉取 验证

$git pull

猜你喜欢

转载自blog.csdn.net/qq_41966668/article/details/80077610