Resolving merge conflicts

Git is good at automatically merging the file changes, but it can sometimes throw merge conflicts. In such a case, you will have to manually resolve the conflicts before syncing your local and remote branch.

When there are merge conflicts, Visual Studio 2017 will list down the conflicts under the Merge In Progress panel of the Sync view. Click on the Conflicts link to start resolving the file conflicts:

This will bring up a list of files with conflicts. Selecting a file lets you accept the changes in the source branch where you are merging. You can also compare the files by using the Diff link and compare with Remote or Local.

From the same screen, you can also take the remote changes or keep the local changes. If you want to review the changes and manually want to do a merge operation, click on the Merge button, as shown in the following screenshot:

This will show you a side-by-side view of your source and target, along with the resultant changes to the file. Use the checkboxes present next to the modified lines under merge conflicts to select between the remote and the local changes. You can also modify the lines directly in the Result panel.

When you are done with the changes, click on the Accept Merge button to accept the changes performed for the conflicts. You need to perform the same for all the conflicts that you have, before continuing with the synchronization between local and remote branches, as shown in the following screenshot:

Once you are done resolving all the conflicts, you can go to the Changes view and commit the merged changes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.252.8