'Perforce to git migration [closed]

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



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 khagler