1) Install Cygwin or Bash on Windows 10
Cygwin
- Run setup.exe
- Select Install from Internet
- In the Select Packages dialog box:
- Click Install at the top of the tree (next to All) until it shows Default
- Expand the Devel subtree: Install git (change from Skip to the version number)
- In the Devel subtree: Install mercurial (change from Skip to the version number)
- Install Python subtree (change from Default to Install)
- Click Next
- If prompted to resolve dependencies, click Next
- Get a cup of coffee, watch your favorite movie, or take a long nap
After the Cygwin installation is complete, open a bash shell to run the commands indicated in the steps below. The shortcut to bash will be called Cygwin Terminal.
Windows 10
- Install Bash on Windows 10
- Get a cup of coffee
- Open Bash and type the following:
- sudo apt install git
- sudo apt install mercurial
2) Install fast-export
Open terminal (bash shell) and install fast-export:
https://github.com/frej/fast-export.git
3) Initialize new git repo and migrate mercurial repo
mkdir new_git_repo
cd new_git_repo
git init
../fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo
git checkout HEAD
Potential Error
fatal: Invalid raw date "<devnull@localhost> xxx -xxxx" in ident: <><devnull@localhost> xxx -xxxx
Try adding an "authors.txt" file as described here, containing:
<>=devnull <devnull@localhost>
The command line now reads:
../fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo -A ../fast-export/authors