3

I need to migrate repos from perforce to git with all the history. I tried searching through the web, but didn't find any clear documentation mentioning each and every step in detail. I saw an utility called git-p4 but didn't find any clear documentation related to that utility too.

Can somebody explain me on how I can perform this or provide me with the documentation that is helpful.

Regards

1

1 Answer 1

9

There's official documentation available on git-p4. It addresses the specific scenario you describe:

To reproduce the entire p4 history in Git, use the @all modifier on the depot path:

$ git p4 clone //depot/path/project@all

Note that if you have labels in your Perforce depot you'll need to add the --import-labels option to get them. If you have branches in Perforce, you'll want to look at the --detect-branches option as well.

Note that after running this command you'll have a p4 remote in your git repo. That's for people who plan to submit from git back into p4, but since you mentioned that you were migrating you can safely delete it.

Sign up to request clarification or add additional context in comments.

1 Comment

This is good information, but the documentation is dense, without useful examples, and will lead to a very long series of unsuccessful migrations before one finally works, and even that "success" probably won't have the desired results. The doc overloads the word "branch" so heavily that it's impossible to keep track of the context. Given that, searching the web for an actual tutorial or someone's walkthrough is probably a good next step.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.