首先切换到想要合并到的分枝下,运行’Git merge’命令 (例如本例中将test2.x分支合并到xm3.0分支的话,进入xm3.0分支运行git merge test2.x命令)如果合并顺利的话:
确保当前分支为xm3.0
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git status
On branch xm3.0
nothing to commit, working directory clean
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch
master
test2.x
* xm3.0
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git merge test2.x
合并冲突处理:
Automatic merge failed; fix conflicts and then commit the result.
或是图形化界面直接merge;比如现在在master分支,选中dev分支后,直接点击Merge into Current,就把dev分支的内容同步到master了