TIP: Perforce – Sync Files In A Label Without Deleting Previous Files

If you have used perforce, you’d have definitely come across a situation where you wanted to sync files belonging to two different labels, but as soon as you sync the second label, the files from the first label get deleted. P4 help suggests the following ways to achieve this:

 p4 sync @label1,label2

or something like


 p4 sync @label1,@label2

But I’ve found that depending on the perforce version you are using, the above commands might not work. So, here is a tip that will always work for you irrespective of which version you are using:

p4 files @label | cut --delimiter=" " -f1 | p4 -x - sync -n

It is as simple as that. Let me know what are your perforce tips..

2 comments to TIP: Perforce – Sync Files In A Label Without Deleting Previous Files

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

SUBSCRIBE!





Tweet