ptamzz ptamzz - 4 months ago 19
Git Question

How to resolve Git merge conflict

I am new with github and am trying to merge my master and gh-pages branches.

While trying to merge, I had a conflict. Now I get the following message

enter image description here

How do I fix it?

Answer

Take a look at your current status:

git status

You'll probably see some files which are staged for commit and some which have local changes. The staged ones are those which merged without problem. The ones with local changes have merge conflicts. Open up each of those files, and you'll see something like this somewhere inside:

<<<<< master
// some code that was in master
=====
// some code that was in gh-pages
>>>>> gh-pages

(I think it's something like that anyway)

Edit each of them so they are how you want them to be (ie: fix the conflicts). Then do as it says:

git add the/file/i/fixed.txt
git commit