Migrate from Perforce to Git
I had been using Perforce for revision control mostly for Windows and binary files (excel, PDF, etc.). It worked amazingly well and had a powerful GUI! However I finally decided to consolidate on Git.
Primary instructions are from git scm
In CentOS you will need the helper package:
$ sudo yum install git-p4 The following steps worked perfectly for me.
My Git projects are in ~/git (where the converted project will end up) My Perforce server is on atlas I use ~/work as my working directory (where I clone, checkout, etc.
Migrate from Mercurial Hg to Git
I had one last Mercurial project that I still actively developed. Everything new I’ve completed restarted with Git but this was a last hold out.
I blindly followed this Stack Overflow answer which says to use fast-export. However I ran into the following problem, and the Stack Overflow answer didn’t help much.
$ git push origin master remote: error: refusing to update checked out branch: refs/heads/master ... ! [remote rejected] master -> master (branch is currently checked out) error: failed to push some refs to '/home/mirandam/git/project' After some trial and error, the following steps worked exactly how I expected.