Perforce Merging

A former colleague has a great Perforce FAQ and in it he writes a lot about how to do a merge.

If you are doing a simple merge one can do it on the code line like in this example.

> p4 integ //depot/foo/...@17,@17 //depot/bar/...
> p4 resolve -am
> p4 submit

(Some people suggest doing p4 resolve -as && p4 resolve -am. The -as is the simple resolve.)

You can also do a simple merge of a file like in this example.

> p4 integ //depot/foo/frank.java#7,#7 //depot/bar/frank.java
> p4 resolve -am
> p4 submit

Sometimes Perforce will not do the integration and say “all revision(s) already integrated.” In that case you can force the revision by using the -f flag.

> p4 integ -f //depot/foo/frank.java#7,#7 //depot/bar/frank.java

Leave a Reply

Your email address will not be published. Required fields are marked *