How can we resolve a merge conflict in GIT?

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

E.g.
the business days in this week are
<<<<<<< HEAD
five =======
six

>>>>>> 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.

Read the full book at www.amazon.com
Posted in GIT, GIT Interview Questions

Leave a Reply

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

*