1.首先切换到想要合并到的分支(这里是master)下
$ git checkout master
2.运行’git merge 分支名’命令
$ git merge develop
3.将本地的master分支推送到远程master分支上
$ git push origin master:master
4.从云托管代码平台上拉代码下来发现代码已经更新
第一步可能出现问题:
$ git checkout master
error: Your local changes to the following files would be overwritten by checkout:
test.java
Please commit your changes or stash them before you switch branches.
Aborting
解决方案:
$ git add . && git commit -am "提交名称"
第二步可能出现问题:
$ git merge develop
error: Merging is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
解决方案:
修改冲突的文件后,git add 文件 然后,git commit