Perforce Print
If you want to access a version of a file that you have not synced and do not want to sync first, you can run this command:
|
p4 print filename<version> |
|---|
By default (without the "version"), it will display the head version, equivalent to this:
|
p4 print filename#head |
|---|
However, you can specify any version number like this:
|
p4 print filename#5 |
|---|
Or, you can specify any CL number like this:
|
p4 print filename@1234567 |
|---|
The "p4 print ..." command is great for text files, but what if you want to execute an older version of a binary file. You would have to re-direct the output of "p4 print ..." to another file like this example and then you can run this new file.
|
p4 print -o new_file filename#4 .\new_file |
|---|
Note that a "#" symbol is used for version numbers, have, and head. And the "@" symbol is used for CL numbers.
by Phil B.