Phil for Humanity Phil for Humanity
A Guide for the Survival of Humankind and Helping the World, Society, and Yourself.



Perforce Resolve


Whether you are integrating two branches together or syncing to a newer version of a branch/directory, you will probably have merges that need resolving.

To just list your unresolved merges, run this command:

p4 resolve –n

To have Perforce try to automatically merge, you can run this command:

p4 resolve –am <file>

This command will only automatically merge if there are no conflicts (the same line modified by both you and somewhere else). If there are no conflicts and your version has not been modified, then their version will be accepted as the resolution. If there are no conflicts and their version has not been modified, then your version will be accepted as the resolution. Binary files will not be automatically merged. Without listing files, the command will run on all unresolved files.


To automatically accept their version, thus ignoring your version, run this command:

p4 resolve –at <file>

To automatically accept your version, thus ignoring their version, run this command:

p4 resolve –ay <file>

To resolve conflicts, I strongly recommended that you use the GUI diff tool that comes with Perforce.

by Phil for Humanity
on 20110725

Related Articles
 » Perforce P4Merge
 » A Call for More Multinational Currencies
 » Git Merge