-
Notifications
You must be signed in to change notification settings - Fork 0
Perforce
p4 sync # sync the whole client
p4 sync ... # sync current folder
p4 sync <file path> # sync the specified file
p4 sync ...@<changelist> # sync to a changelist
p4 sync ...#<revision> # sync to a revision
p4 sync -n ... # list files will be synced, but don't really do the sync
p4 changes ... # list the changes in the current foloder
p4 changes -m1 ... # list the latest change
p4 changes ...#have # list changes in the local
p4 changes -m1 ...#have # list the current latest change in the local
p4 changes -c <client> # list the changes of the specified p4 client
Perforce Knowledge Base: Using RCS keywords
Files of Perforce type text+k or text+ko can have RCS-style keyword strings inserted in them.
As of Release 2000.1, Perforce expands the following keywords in text+k (ktext) files:
$Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Author$
Print all lines of file.c, each line preceded by the revision that introduced that line into the file.
p4 annotate file
Print annotate for all lines, including deleted lines and lines no longer present at the head revision.
p4 annotate -a file
Display the changelist number, rather than the revision number.
p4 annotate -c file
Common practice
p4 annotate -ac
p4 annotate -ai
The workflow of integrating selected versions between different branches is called Cherry Pick. You basically restrict the base and contributors.
p4 integ //source_depot_path/...@CHANGE,CHANGE //target_depot_path/...
p4 integ //source_depot_path/...@CHANGE,@CHANGE //target_depot_path/...
p4 integ //source_depot_path/...#VERSION,VERSION //target_depot_path/...
p4 integ //source_depot_path/...#VERSION,#VERSION //target_depot_path/...
When you have some files changed locally, but you didn't touch them with "p4 edit" or "p4 add", you can use the p4 diff
command to find the locally changed files.
p4 diff -f -sa
- -f: force the diff
- -sa: set display option. Show only the names of opened files that are different from the revision in the depot, or are missing.
- -sb: Show only the names of files opened for integrate that have been resolved, but that have been modified after being resolved.
- -sd: Show only the names of unopened files that are missing from the client workspace, but present in the depot.
- -sl file: Every unopened file is compared with the depot, and listed with a status of same, diff, or missing. If you use the -f option together with the -sl option, files that are open for edit are also compared and their status is listed.