【git合并分支到master上】 假如我们现在在dev分支上,刚开发完项目,执行了命令下列命令
gitadd .
gitcommit -m ‘dev'
git push -u origin dev
- 1
- 2
- 3
首先切换到master分支上
gitcheckout master
- 1
git pull origin master
- 1
然后我们把dev分支的代码合并到master上
gitmerge dev
- 1
git status
- 1
On branch master
Your branch is ahead of 'origin/master' by 12 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
- 1
- 2
- 3
- 4
执行下面命令即可
git push origin master
- 1
转自:http://blog.csdn.net/boysky0015/article/details/78185879