Perforce Cheat Sheet

SCM , Perforce Add comments

Here is a set of useful Perforce commands that run under the P4 command-line. Much of this functionality is available through the P4V GUI provided by Perforce, but some things (such as extracting several labels into a release directory) are not.

verify your depot
p4 verify -q //...

make a checkpoint and start a new journal (must be a superuser)
p4 admin checkpoint

add new files to default change list
p4 add filename 

open files in the depot for edit (this puts them in the default changelist)
p4 edit //depot/path/to/file/file.name
 
to open in a specific changelist
p4 edit -c 7 //depot/path/to/file/file.name
 
revert a file
p4 revert //PCRCF1/WebInsight/public/Application.cfm
(changelist doesn't matter, you can only have a file open in one changelist) 
 
submit a changelist
p4 submit -c changelist
 
view all pending changes(uncluding checked out files that are in named changelists (not default)):
p4 changes
or
p4 changelists
 
change client (workspace):
p4 set P4CLIENT=Releases
 

view current client details (and edit if you wish):
p4 client 

change back to dev workspace:
p4 set P4CLIENT=NAMEOFWORKSPACE
 
list labels:
p4 labels  

see the detail of a label:
p4 label iAMTheLabel 
 
sync by label
p4 sync @labelname 

For a release, use -p to prevent the server from knowing about the sync
p4 sync -p @label1
p4 sync -p @label2 
Will get label1, then label2 without deleting @label1 
 
to display list of files:
p4 have 

make a new changelist:
p4 change
- this opens with anything you may have in default listed in the files list. To make a new empty changelist delete the files portion and enter a description. 

delete a pending changelist (must be empty)
p4 change -d changelist# 

first remove all files from it (or move them to another changelist)
p4 change -d changenum

move all files to another changelist
p4 reopen -c changenum filenames
use //... for all 

move files to the default changelist
p4 reopen -c default filenames 

remove files from the changelist and discard any changes:
p4 revert -c changenum

0 responses to “Perforce Cheat Sheet”

Leave a Reply



Powered by Mango Blog. Design and Icons by N.Design Studio