Convert a Mercurial repository to Git on Windows 10
If no problem with encoding - use TortoiseHG Hg-Git extension
md new-repo && cd new-repo git init --bare .git cd ..\old-mercurial-repo hg bookmark -r default master hg push ..\new-repo cd ..\new-repo git config --bool core.bare false
If something wrong with encoding - use fast-export
Install Bash
Open PowerShell as Administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Install Ubuntu 16.04 LTS from Microsoft Store
Open Bash and run
install mercurial
sudo -s apt-get update apt install mercurial
get fast-export v180317 (at the moment versions after 180317 does not work correctly)
cd /mnt/c/path_to_work_folder git clone https://github.com/frej/fast-export.git cd fast-export git checkout tags/v180317 cd ..
convert repository
git init new-repo && cd new-repo git config core.ignoreCase false && git config core.quotepath off ../fast-export/hg-fast-export.sh -r ../path_to_mercurial_repo/ --fe cp1251 git checkout master
encoding options:
-f encoding, like -f cp1251 --fe file name encoding like --fe cp1251
Support for importing Mercurial, [...] repositories ended on April 12, 2024