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:
I think there are some misunderstandings of both perforce and git here. In some ways they're more alike than it seems.
Think of it like this:
When you just map a depot to a local workspace, that's like having a ".svn" folder - a local checkout of remote files.
But when you use the "local server", it's really more like having a ".git" folder where you have the ability to create all your own streams and branches and files and version numbers...
So p4 totally has a concept of push: http://ftp.perforce.com/perforce/r16.2/doc/manuals/cmdref/p4_push.html