Monday, July 7, 2008

Perforce commands FAQ

1) How to delete a Perforce client?
p4 client -d

2) How to copy named template's view to current client?
p4 client -t

3) What is the use of P4CONFIG environment variable?
You can define Perforce environment variables in this configuration file. Place this file in your client root or even top-level directory. Perforce will fetch values from this configuration file.
For Ex: setenv P4CONFIG .p4config
cd $P4ROOT
vi .p4config
P4PORT=localhost:1666
P4CLIENT=client1

4) How to retrieve a file revision from Perforce depot?
p4 print -q //depot/source/proj1/test.c#5 > test.c

5) How to add the entire directory to Perforce?
find . -type f|p4 -x- add
find . -type l|p4 -x- add -t symlink

6) How to check who all working(opened) on a given file?
p4 opened -a

7) How to list opened files that are different than the revision in the depot or missing?
p4 diff -sa

8) Listing unopened files that are missing on the client
p4 diff -sd

9) Listing unopened files that are different from the revision in the depot
p4 diff -se

10) Listing opened files that are same as the revision in the depot
p4 diff -sr

11) How to revert all files opened for edit but have unchanged content?
p4 revert -a

12) Locking an opened file against submission
p4 lock file-name
To unlock
p4 unlock file-name

13) How to list the differences between the 2 branches?
p4 diff -q //depot/main/jam/... //depot/rel1/jam/...

14) Deleting and re-adding files
% p4 delete file.txt
//depot/src/file.txt#33 - opened for delete
% p4 submit
Delete //depot/src/file.txt#34
Change 145 submitted
% p4 sync file.txt#33
% p4 add file.txt
%p4 submit
Add //depot/src/file.txt#35
Change 146 submitted

1 comment:

Anonymous said...

This does not mean, necessarily, letting down your guard and pouring your heart out about how much you love your grandmother. The whole professional vs. personal ratio also has to be calculated with your topic and target audience in mind. If you're having second thoughts about writing something in your blog that might be crossing the line, it's best to err on the side of caution and leave it out.

[url=http://jordansoutletgc.inube.com/]jordan shoes[/url]


As you get more comfortable with the process, you'll develop your own unique blogging style!

[url=http://louisvuittonhandbags8.is-best.net/]lv handbags[/url]