Git | Perforce Command Line | P4V | Notes |
---|---|---|---|
git pull | p4 sync | get latest revision | |
n/a | p4 update | ? | Get latest revision without overwriting files that have been changed. |
git checkout | p4 edit | checkout | You plan to change a file from the version control system |
git commit | p4 submit | submit | |
git push | n/a | n/a | No perforce equivalent. There is no concept of a pure local submit in Perforce. |
git status | p4 status | ? | |
git stash | p4 shelve | ||
git blame | p4 annotate |
Git | Perforce |
---|---|
Git | Perforce |
Repository | Depot |
Local Repository | Workspace |
1 - Get the files from the server
cd /Users/turtle/work
p4 sync
2 - Checkout the file you want to work on and modify it
p4 edit main/foo;
echo cake >> main/foo
3 - Submit it to the server
p4 submit -d "A trivial edit"
- Revert all changes
p4 revert //...
- Restore workspace files to match the state of corresponding depot files.
p4 clean
Resources:
In git, you do not need to tell the system you are going to edit a file.
git checkout file.txt
reverts any changes that were made to the file back to the version in the current repo.
This is not equivalent to
p4 edit