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 u开发者_StackOverflow社区ses Perforce for their source control, but I would like to use git locally.
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.)
精彩评论