Resolving Merge Conflicts

See Also

When you use a version control system, you might need to merge changes you made to a file with changes made to the same file by someone else. When you update a locally modified file, CVS automatically merges changes from the repository with changes made to your local file. But when conflicts occur, you must decide how to resolve each conflict before you can check your local file into the repository.

Each conflict is marked with arrows followed by the lines from the two files that caused the conflict. To resolve conflicts manually in the source file, delete the arrows and the text that you do not want for each conflict in the file. You can also use the Merge Conflicts Resolver to fix merge conflicts graphically in the IDE.

To resolve merge conflicts through the Merge Conflicts Resolver:

  1. In the Filesystems window, right-click the node of any file whose status is Merge Conflict and choose Resolve Conflicts from the contextual menu.
  2. The Merge Conflicts Resolver is displayed. Merge conflicts are highlighted in red. The icons in the upper-lefthand corner allow you toggle through the conflicts in the file.

  3. For each conflict, decide which pane has the text that should be accepted.

    If neither pane has the text you want, open your source file and edit it. When you are done making changes, right-click the node of your source file and choose CVS and choose Update from the contextual menu. Then repeat Step 1 in this section.

  4. Click Accept above the pane that has the text that you want.

    The text you chose is now highlighted in green and is displayed in the Merge Result pane. The text in the pane you did not choose is highlighted in blue.

  5. When you have resolved the conflicts, click OK.
Note The Merge Conflict Resolver is also available for PVCS filesystems.
See Also
Merging File Revisions
Creating and Applying a Patch
Comparing File Revisions Visually
Versioning Window

Legal Notices