Blog | Tech Blog | Secure Coding | Twitter | RSS Feed | Get Email Updates

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:

CODE:
  1. p4 sync @label1,label2

or something like

CODE:
  1. 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:

CODE:
  1. p4 files @label | cut --delimiter=" " -f1 | p4 -x - sync -n

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

© Shantanu Goel | TIP: Perforce – Sync Files In A Label Without Deleting Previous Files

Custom Search
Liked this post? Get FREE Updates
Subscribe to RSS feed

Or
Enter Your E-mail ID below

Share and Enjoy:
  • Digg
  • del.icio.us
  • StumbleUpon
  • Facebook
  • Reddit
  • Print this article!

Related posts