git: cannot merge

git: 提交代码后出现cannot merge

原因:A、B同时修改代码,A提交了代码并被merge,B没有更新A代码的i情况下,提交了代码,审核界面显示:Cannot Merge.

git status: 显示

On branch xtrem-ma100
Your branch is ahead of 'origin/****' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

尝试使用解决方法:

git push origin master

提示:

To ssh://10.10.0.49:29418/INP-Newapple
 ! [rejected]        *** (fetch first)
error: failed to push some refs to 'ssh://***'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方案:

1.git pull origin master
2. git push origin master

 

你可能感兴趣的:(git: cannot merge)