I have 2 branches, master and newfeature. When I want to merge newfeature into master, I used:
git checkout master
git merge newfeature
I get the error:
Auto-merging .gitignore
CONFLICT (content): Merge conflict in .gitignore
Automatic merge failed; fix conflicts and then commit the result.
I opened up .gitignore and it looks like a mess now with the last part of the file looking like
<<<<<<< HEAD
public/img/ignore
=======
public/img/profiles
public/blog
public/recommendation
>>>>>>> newfeature
What happened, and how should this be fixed so that I can merge the branch into master?
You edited the .gitignore in both branches. Now, git is unsure of which lines in each copy are the correct ones so it is asking you to resolve them.
The lines:
Are what appears in the copy of the file in master.
And
in the branch newfeature
You should just have to edit the file as you would like it to appear finally. Then…