git 解决冲突

醉酒当歌 提交于 2020-02-26 11:59:04

1、提交本地修改的代码

git commit -a -m ' 1、提交了什么内容'

2、拉取并合并远程服务器代码

git pull --rebase origin develop

3、如果有冲突(需要手动解决冲突或者工具解决冲突)

rebase in progress; onto e26bb
You are currently rebasing branch 'develop' on 'e26bb'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)
  
  Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
  modified:   src/main/java/com/controller/UserInfoController.java
  
  Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

  both modified:   src/main/java/com/service/UserInfoServiceImpl.java

4、解决所有冲突文件之后,需要执行命令 git add -A

(use "git add <file>..." to mark resolution)

git add -A

5、所有冲突解决之后,需要执行命令 git rebase --continue

all conflicts fixed: run "git rebase --continue"

git rebase --continue

6、最后看一下状况

git status

7、没问题后,提交到远程仓库

git push origin develop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!