# Common base version of the file.git show :1:some_file.cpp
# 'Ours' version of the file.git show :2:some_file.cpp
# 'Theirs' version of the file.git show :3:some_file.cpp
git fetch origingit pull origin master
From ssh://gitosis@example.com:22/projectname* branch master -> FETCH_HEADUpdating a030c3a..ee25213error: Entry 'filename.c' not uptodate. Cannot merge.
所以你更新并再试一次,但有冲突:
git add filename.cgit commit -m "made some wild and crazy changes"git pull origin master
From ssh://gitosis@example.com:22/projectname* branch master -> FETCH_HEADAuto-merging filename.cCONFLICT (content): Merge conflict in filename.cAutomatic merge failed; fix conflicts and then commit the result.
<<<<<<<Changes made on the branch that is being merged into. In most cases,this is the branch that I have currently checked out (i.e. HEAD).|||||||The common ancestor version.=======Changes made on the branch that is being merged in. This is often afeature/topic branch.>>>>>>>
(Code not in Conflict)>>>>>>>>>>>(first alternative for conflict starts here)Multiple code lines here===========(second alternative for conflict starts here)Multiple code lines here too<<<<<<<<<<<(Code not in conflict here)
以您希望新代码的方式选择其中一个替代方案或两者的组合,同时删除等号和尖括号。
git commit -a -m "commit message"git push origin master
With this option, merge-recursive spends a little extra time to avoidmismerges that sometimes occur due to unimportant matching lines(e.g., braces from distinct functions). Use this when the branches tobe merged have diverged wildly.
git diff++<<<<<<< HEAD+ display full last name boolean in star table++=======+ users viewer.id/star.id, and conversation uses user.id+++>>>>>>> feat/rspec-tests-for-cancancan