[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)
-
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. -
Since the readme.md file is modified in both branches when we merge branch
sam/test/commit
tosam/test/commit2
, there will be conflicts. -
Go to
Team Explorer > Branches > Merge
. InMerge from branch
drop-down, selecttest/commit
(the branch created in step 4). ClickMerge
. -
You will see there are conflicts. Click
Conflicts:
. It will jump to Resolve Conflicts tab -
Select the file in the conflicts list and click
Merge
-
It brings up a merge tab, click
Accept Merge
after resolving conflicts. -
Click
Commit Merge
from Resolve Conflicts tab. -
Enter commit message and click
Commit Staged
-
Click Sync from to yellow notification message to go to
Synchronization tab
-
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
- Click
(To continue next step, you can leave things without doing any action like sync or push)
The whole process:
Using Visual Studio as diff/merge tool in Git and SourceTree