- 首先确定要合并哪个远程分支,先查看一下都有哪些远程分支
git branch -r
- 拉取最新要合并的分支代码到一个临时分支
git fetch origin <要拉取的分支名>:temp
- 可以查看一下当前分支和临时分支都有哪些不同的地址
git diff temp
- 合并临时分支到当前分支
git merge temp
- 删除临时分支
git branch -d temp
git branch -r
git fetch origin <要拉取的分支名>:temp
git diff temp
git merge temp
git branch -d temp