1、$ git checkout work
在要合并的目录下checkout分支
2、$ git merge dev
合并分支
Updating f08de8..494c33
Fast-forward
.../controller/Ar***********.java | 56 ++++++++++++++--
.../**************.java | 32 +++++++++
8 files changed, 332 insertions(+), 38 deletions(-)
create mode 100644 src/main/webapp/views/**************.jsp
3、$ git status
可以检查下状态
On branch workYour branch is ahead of 'origin/work' by 3 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
4、$ git pull origin work
拉取分支进行合并
remote: Counting objects: 24, done.remote: Compressing objects: 100% (20/20), done.
remote: Total 24 (delta 0), reused 15 (delta 0)
Unpacking objects: 100% (24/24), done.
From http://****************************
* branch work -> FETCH_HEAD
f08de8..e1344d work -> origin/work
Auto-merging src/main/webapp/views/***************.jsp
CONFLICT (content): Merge conflict in src/main/webapp/views*************.jsp
Auto-merging src/main/webapp/WEB-INF/decorators.xml
Automatic merge failed; fix conflicts and then commit the result.
5、修改冲突文件,修改完成后右键Resolve
6、测试代码,确保提交代码无问题
7、提交代码