How can we resolve a merge conflict in GIT?

When GIT reports merge conflict in a file, it marks the lines as follows:

the business days in this week are
<<<<<<< HEAD
five =======

>>>>>> branch-feature

To resolve the merge conflict in a file, we edit the file and fix the conflicting change. In above example we can either keep five or six.

After editing the file we run git add command followed by git commit command. Since GIT is aware that it was merge conflict, it links this change to the correct commit.

Leave a Reply

Your email address will not be published. Required fields are marked *