Hmm, I wonder what could possibly be my tip for the day after yesterday’s tip!
In yesterday’s scenario, you saw how to use VS to do a diff. In today’s tip, you’ll see how to do a merge when you do `git merge branch-name` and get into a merge conflict. Hopefully you’re feeling a bit more confident when you see merge conflict now. (Yeah that’s actually my hope for myself.)
First, go to Team Explorer – Settings – Git – Global Settings and for Merge tool, click Use Visual Studio
Suppose you have a file in one branch (mine is called readme) that contains a conflict. When you go to merge into master, you’ll see a merge conflict.
You can open the mergetool by running
$ git mergetool
Follow the instructions and hit Enter.
Now the VS Merge tool appears
Clean up your readme.txt in the bottom part of the screen (or however you want to use the merge tool).
Now we’ll see that we have changes in our working directory.
You can do a `git add readme.txt` to add this file to staging.
And now we commit our merge commit via `git commit -m “merged readme”`
and the `git log` confirms our merge.