3

Since version 1.8.1 git is including Felipes git-remote-hg . Unfortunately fetching/cloning from a Hg repo with TortoiseGit 1.8.1 and Git for Windows 1.8.1.2 ends in the following error:

fatal: git was built without support for git-core\git-remote-hg (NO_PYTHON=YesPlease).

How do I get python support into my Git?

3

1 Answer 1

3

As mentioned in previous answers none of the msys based git solutions for Windows have python support. Eventually they may have time to add it but who knows when that will happen.

In the meantime, git-remote-hg does work with Cygwin's git. Here's what I did to try it out:

  1. Download the latest Cygwin setup.exe

  2. Run setup.exe and install latest git, mercurial, and openssl packages (in addition to whatever packages it wants to install). I installed mine in c:\cygwin.

  3. Download git-remote-hg and put it in c:\cygwin\bin. (There may be a more appropriate place to put this file, but I didn't bother to figure out where that might be.)

  4. I added c:\cygwin\bin to my PATH so I could use git commands from the Windows command prompt.

    It is worth noting that if you're using TortoiseHg or some other mercurial or python, putting c:\cygwin\bin in your path could cause those programs to misbehave. A more robust solution would be to make a .cmd file that modifies the PATH to include Cygwin's bin directory or just use Cygwin's bash shell.

  5. Find some hg repo to clone. (I created one at c:\hg\test and used hg serve).

  6. Clone with git:

    git clone hg::http://localhost:8000/

5
  • I fixed the link to git-remote-hg. It's coming from the github.com/git/git repo now and I have it from a tagged version so that link shouldn't change.
    – ZombieDev
    Nov 13, 2013 at 0:09
  • Thanks :). Although I ended up not being able to use it because there is no Windows version of Git that includes Python
    – Joey
    Nov 13, 2013 at 6:01
  • That's what steps 1-2 are about. If you use cygwin for git, it will have python too.
    – ZombieDev
    Nov 20, 2013 at 15:05
  • 1
    There is no reason for a Git version on Windows requiring Python. I have msysGit installed, and git-remote-hg seems to with stock Python 2.7. Just make sure python.exe is in your path, so Bash can find it. It might work just as well with Git for Windows, but I haven't tested.
    – Attila
    Nov 29, 2013 at 14:32
  • I came across this looking for a solution to the exact same error message while using git-p4. Simply installing cygwin git and using that instead seems to be sufficient for git-p4.
    – bacar
    Sep 15, 2014 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.