Integrate existing Git Repository with Perforce (P4)
I have browsed through the web, but I cannot find an answer.
What I am trying to do is the following:
- I have a git repository which has been used for over 1 year with lots of commits
- Due to productization, the code has to be moved into a P4 rep.
- However, the codebase (after transport) may change in git as well as P4
Now lets assume that reference branch in git is master
- Mercurial/Git: Different directories for different branches in same repository
- How would you measure inserted / changed / removed code lines (LoC)?
- Git p4 merge pull request
- Where can I find the patience diff implemented?
- Perforce - getting email on every checkin
- Is there a script that provides the equivalent to git-bisect for Perforce (p4)?
What I did is the following:
- Copy the latest code from git into P4 and submit it there
- Use git-p4 sync –branch=refs/remotes/p4/masterp4 //../ in order to create a new branch in my existing repository
- git merge master into masterp4
- does not work since a common commit is missing
- git-p4 submit, moreover, is not able to work with merge commits anyway
Another option was rebasing
- Start with an empty repository in P4
- Use git-p4 sync to create an empty masterp4 branch in git
- Rebase master onto masterp4
- Rebase masterp4 onto remote/p4/master
- Leads to thousands of p4 changelists.
The main problem is the broken link between the master branch and this masterp4 branch.
I wondered if there is not an easier solution anyway. Unfortunately, I am a git n00b.
Thanks for any ideas,
One Solution collect form web for “Integrate existing Git Repository with Perforce (P4)”
I’d go with creating 1000s of Perforce commits, so that history is preserved.