Can't convert a Git repository to Mercurial
-
27-06-2021 - |
Question
I have Git repository that I'm trying to convert to Mercurial. Running
hg convert c:\code\git-repo
results in the following error:
assuming destination git-repo-hg initializing destination git-repo-hg repository abort: cannot find required "git" tool
I have the Git Hub for Windows application installed. Am I missing something else?
Solution
Thanks to the help of dimo414 and J-16 SDiZ I was able to fix it. The problem was that GitHub for Windows didn't setup the location of Git into the Windows Path. Adding it to the path or simply running the hg convert from within the Git folder should work.
OTHER TIPS
From the error, it sounds like hg convert
expects to be able to use the git
command line tool. What happens if you run git --version
from the command prompt? If not, you should be able to install it from the Git downloads page. If it's already installed, you probably haven't added git
to your Windows PATH
.
An alternative is to use hg-git
which allows you to clone and push to a remote Git repository as a Mercurial repository.
Try to add environment variable with 'git' name and path to git.exe value.