A real-world coexistence tool when you can't migrate yet.
A two-way bridge between Git and Perforce. The real coexistence tool when management will not let you migrate yet.
git p4 clone pulls P4 changelists into Git commits; git p4 submit reverses the flow, turning your Git commits into P4 changelists. Branch detection and client-spec handling are the sharp edges.
git p4 <subcommand> [<options>]
Requires the p4 CLI on PATH and a working P4 environment (P4PORT,
P4USER, P4CLIENT). State lives under refs/remotes/p4/ and in the
git-p4.* config namespace. Treat the imported branches like any
other remote-tracking refs.| Flag | What it does |
|---|---|
--branch <name> | Name (or rename) the imported branch; defaults to refs/remotes/p4/master. |
--detect-branches | Walk P4 branch specs and import each as its own Git branch instead of one linear history. |
--keep-path | Preserve the full P4 depot path inside the Git tree instead of stripping the depot prefix. |
--use-client-spec | Honor the current P4 client view when mapping depot paths to working-tree paths. |
--shelve | On submit, create a P4 shelved changelist instead of submitting outright. |
--import-labels | ⚠️ Import every P4 label as a Git tag; on large depots this can create thousands of refs. |
git p4 clone --detect-branches //depot/proj@all proj.gitgit p4 syncgit p4 rebasegit p4 submit --shelvegit p4 branchesgit p4 clone --detect-branches --use-client-spec //depot/proj@allgit p4 rebasegit p4 submitgit p4 submit --shelve --update-shelve 1234Hit each option, then Check answers. Score is recorded; Next is always open.