I had to convert the Mercurial (hg) repository to Git repository, and by lot of advises on the Internet, I’ve decided to use Fast Export.
Clone Fast Export
1
|
|
Create a new repository
1 2 3 |
|
Problems running Fast Export
Getting to know Python with the Mercurial
By running Fast Export I got error message:
1
|
|
Essentially this means that Python does not know about Mercurial.
The fix for that would be to install Mercurial as a Python module. I’ve used easy_install
:
1
|
|
Using “force” option
The next error was:
1
|
|
To fix it there was need to set Fast Export with parameter --force
.
Starting Fast Export
Make sure you are in the Git repository that you want to convert to:
1
|
|
Run from it a Fast Export like this:
Note:
Assumes that the Fast Export in directory up and the
hg_repo
is the Mercurial repository directory from where you want to convert from!
1
|
|
After few moments, your Mercurial (hg) repository will be converted to Git one!
And aftrer the conversion is applied run the checkout:
1
|
|
Beware if you have a lots of branches, that pushing master
will only push master. To push evrything to the remote
use:
1
|
|
And now all commits and previous branches are converted to Git!