How to resolve conflicts

To resolve a file conflict, you determine the contents of the files you intend to submit by issuing the p4 resolve command and choosing the desired method of resolution for each file. After you resolve conflicts, you submit the changelist containing the files.

Note

If you open a file for edit, then sync a subsequently submitted revision from the depot, Helix Server requires you to resolve to prevent your own changes from being overwritten by the depot file.

By default, Helix Server uses its diff program to detect conflicts. You can configure a third-party diff program. For details, see Diff files.

To resolve conflicts and submit your changes, perform the following steps:

  1. Sync the files (for example p4 sync //Acme/dev/jam/...). Helix Server detects any conflicts and schedules the conflicting files for resolve.
  2. Issue the p4 resolve command and resolve any conflicts. See Options for resolving conflicts for details about resolve options.
  3. Test the resulting files (for example, compile code and verify that it runs).
  4. Submit the changelist containing the files.
Note

If any of the three file revisions participating in the merge are binary instead of text, a three-way merge is not possible. Instead, p4 resolve performs a two-way merge: the two conflicting file versions are presented, and you can choose between them or edit the one in your workspace before submitting the changelist.