conflictしたファイルを修正しpushする

Posted by Tatsuyano on Sat, Feb 23, 2013
In
Tags git

pullした後に、commitしたファイルdummy.txtがconflictした場合

git pull
Auto-merging dummy.txt # <- dummy.txtがconflictして、auto-mergeされた
CONFLICT (content): Merge conflict in dummy.txt
Automatic merge failed; fix conflicts and then commit the result.

conflictしたファイルを修正する

emacs dummy.txt
<<<<<<< HEAD
local
=======
remote
>>>>>>> 58da51ee64bf7f793167ddb40d035815e39566b4

修正後、git commit -aで再度commitしpush

git commit -a -m 'merge dummy'
[master 102b6c6] merge dummy

git push

git commit -a は git add -u した後すぐにgit commitしたのと同義

conflictしているファイルの表示

git ls-files -u