Documentation/git-p4.txt has additional information in the git source code.
git -p4 supports the refs / remotes / p4 branch to mirror the remote Perforce server. By default, git-p4 clone and git-p4 sync update this remote and you reinstall it on it.
git-p4 submit requires setting up an additional local directory as the Perforce root client for use with p4 submit .
git-p4 sync/clone will write each list of Perforce changes in the corresponding git commit message. For instance:
[git-p4: depot-paths = "//depot/test/": change = 51]
Using these changes in change lists, git-p4 sync retrieves change lists on the Perforce server that are not yet attached to git, adding change list changes to each new git commit message.
git-p4 submit begins by defining new local git commits - without [git-p4: ...] . Using the local Perforce client workspace, it synchronizes the Perforce files, and with git apply applies the fixes received from git format-patch in the unconfirmed git declaration before calling p4 submit .
Then git-p4 submit calls git-p4 sync to update the ref / remotes / p4 branch against the newly updated remote Perforce.
Finally, git-p4 submit will invoke git rebase on the main branch on the updated remote. This leads to the same git tree that was sent, but with edited commit messages containing [git-p4...] entries in the change list.
How to save multiple files modified in git without sending them to p4?
git-p4 submit will send all the branches. Use the usual git tools to organize changes to and from the branch that you decide to submit to Perforce.
source share