[Step 5] Handle merge with conflicts in VS2017 - Yellow-Team-Millerslab/GitPlayground GitHub Wiki

You can select your merge and diff tool. Here we use VS2017 built-in feature. (See how to do it in SourceTree)

  1. Create another branch from master just like what we have done in step 4 and make some change in readme.md and commit it. It should look like this. There are 2 branches in sam/test/commit. Current branch commit2 is checkout.

  2. Since the readme.md file is modified in both branches when we merge branch sam/test/commit to sam/test/commit2, there will be conflicts.

  3. Go to Team Explorer > Branches > Merge. In Merge from branch drop-down, select test/commit (the branch created in step 4). Click Merge.

  4. You will see there are conflicts. Click Conflicts: . It will jump to Resolve Conflicts tab

  5. Select the file in the conflicts list and click Merge

  6. It brings up a merge tab, click Accept Merge after resolving conflicts.

  7. Click Commit Merge from Resolve Conflicts tab.

  8. Enter commit message and click Commit Staged

  9. Click Sync from to yellow notification message to go to Synchronization tab

  10. In Synchronization tab, You can

    • Click Sync to pull and push the change you have committed locally
    • Click Fetch, Pull, Push to do things just like in Mercurial
    • Click Actions > View History to show you the branch graph

(To continue next step, you can leave things without doing any action like sync or push)

The whole process:

Do it in SourceTree

Using Visual Studio as diff/merge tool in Git and SourceTree