Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anything similar to git-svn for Perforce?

Tags:

git

perforce

Is there a tool that allows me to gain the same functionality as git-svn for Perforce? I saw git-p4 on github but it looks like this imports source from a git repo to a Perforce repo. Does it go the other way around? Is it intended to be used as a frequent tool or just a 1 time, import-only type of tool?

Scenario: I am a contractor, my client uses Perforce for their source control, but I would like to use git locally.

like image 928
Michael Brennan Avatar asked Dec 23 '09 18:12

Michael Brennan


1 Answers

git-p4 can go both ways. Use git-p4 sync or git-p4 rebase to update your local workarea, then use git locally. When ready to submit your git commits into p4, use git-p4 submit.

You will need to create a P4 client (in a separate place from your git workarea) and use it exclusively for synchronizing using git-p4.

I use this locally and it has been working well for months, with a few caveats:

  • You can use git branches locally but P4 will not know anything about them. It will see only master.

  • File renames will show up in P4 as add+delete instead of the preferred integrate+delete.

  • Git commits are recreated when running git-p4 submit, so the timestamp will be off, and you may have merge issues with your other git branches. (Just like the "recover from upstream rebase" problem.)

like image 158
ScottJ Avatar answered Sep 18 '22 01:09

ScottJ