github 分支同步
- 首先fork一个项目
- clone你fork的项目
git clone https://github.com/YOUR_USERNAME/YOUR_FORK.git
- 查看下当前的远程分支列表
git remote -v
origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
- 将源仓库地址添加到远程分支中
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
- 更新下远程分支的代码
git fetch upstream
- 切换分支
git checkout master
- 合并代码到本地分支
git merge upstream/master
git指令
合并分支
git merge [分支]
注意:合并之前保证master与【分支】 为最新分支