Git:Perforce Command Mappings

The following table maps Git commands to their corresponding Perforce commands:

Git Command Perforce Command

git add

p4 reconcile

git branch

p4 switch -l

git checkout --orphan new_branch

p4 switch -cm new_stream

git checkout branch

p4 switch stream

git clone repository

p4 clone -p host:port -r remote

git commit

p4 submit

git init

p4 init

git merge branch

p4 merge --from stream

git pull

p4 fetch -u -r remote -S stream

git pull --all

p4 fetch -u

git push

p4 push -r remote -S stream

git push --all

p4 push

git rebase

p4 unsubmit followed by p4 resubmit

git remote

p4 remotes

git remote add new_remote repository

p4 remote new_remote

git status

p4 status

For more details on Perforce commands, see the P4 Command Reference.