Perforce for Git Users

This is a quick cheat sheet guide for git users trying to migrate over to perforce. It does not include an exhaustive list of commands, this is just a simple cheat sheet to get people started.

CommandGit Equivalent Perforce DocumentationNotes
p4 syncgit pull / git fetchhttps://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_sync.html
p4 integrategit mergehttps://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_integrate.html
p4 openedgit statushttps://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_opened.htmlThe git status command isn’t a direct equivalent of p4 opened. However, p4 opened will show what files you have checked out that are not yet submitted.
p4 editgit checkouthttps://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_edit.html#p4_editThe git checkout command is usually used for checking out a branch, there is no direct equivalent in git for p4 edit. All files in p4 must be “checked out” first before they can be checked in.
p4 submitgit push/git commithttps://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_submit.html#p4_submitIn git you usually have to do a git commit command and then a push. In p4, it’s all in one command, and you submit a “changelist”

Leave a Reply

Your email address will not be published.