背景:

一般开发自己的分支都是从最新的master上拉取,但中间master会有改动,此时需要将最新的master合到自己的分支中

 

命令:

1. 查看当前的分支,星号标识为当前分支;(如果查询结果有master分支,则跳到第4步)

 

git branch

 

git 将master分支合到自己的开发分支_git

 

2.查看该工程所有的分支,星号标识为当前分支

git branch -a

git 将master分支合到自己的开发分支_git_02

 

3.copy一个master分支(步骤1中,本地没有master分支,需要copy一个)

git branch -c master

git 将master分支合到自己的开发分支_上拉_03

4.切到master分支

  git checkout master

5.拉取master最新代码

  git pull origin master

6.切到你的分支

git checkout feature-20190813XXXX

7.将mastermeger到你的分支中

 git merge master

8.将你的分支从本地push到远程

git push