Git Merge Conflicts

We can use mergetool to solve conflicts in git.
Here is short (a very short) example. Original post is here.

$ git mergetool

[…]

Both of you have modified planets.md. When you open the file in your text editor, you’ll see both changes:

the number of planets are
<<<<<<< HEAD
nine
=======
eight
>>>>>>> branch-a

In branch-a, you wrote the word “nine,” but your friend wrote “eight.” Git automatically addsconflict markers to the affected areas. A conflict-marked area begins with <<<<<<< and ends with >>>>>>>. These are also known as the conflict markers. The two conflicting blocks themselves are divided by a =======.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s