How do I convert a git repository to mercurial?

I’ve been developing a java application using git as source code repository. I’d like to share the project with other java developers and hg seems to be most used by them.

My question is how do I convert a git repository to hg?

  • Using Git without Sudo in many accounts
  • What is branched in a repository?
  • “You are on a branch yet to be born” when adding git submodule
  • Github (SSH) via public WIFI, port 22 blocked
  • Git shortcut to pull with clone if no local there yet?
  • Git: Prevent fast-forward merges only when merging external branches into master
  • If I tried googling “convert git to hg” and every search hit is about converting from hg to git. I’m also using TortoiseHg.

  • How to uninstall a git repo using pip?
  • How to change different configuration settings between environments in PHP?
  • How to use Github Pages with Dependencies?
  • Lion OS - brew update returns “Failure while executing…”
  • Is my git workflow correct and in accordance with my team?
  • Get the diff in Git for files that have been renamed and then significantly changed. This does not currently work properly for me
  • 9 Solutions collect form web for “How do I convert a git repository to mercurial?”

    The hg convert utility isn’t on by default after installation. In order to set it as such add the following to your .hgrc file.


    If you’re using TortoiseHg on Windows then this file resides in your home directory as mercurial.ini. After this setting change you will be able to use the hg convert utility.

    By using the Mercurial Convert extension

    Add the following lines to your .hgrc or to enable the extension :


    And typing a

    cd src
    hg convert --datesort . dst

    (even though it can lead to some issues…)

    Note:: metrix reports that this might not work:

         hg convert --datesort src dst

    Note: there happens to be a bug with hg convert if you perform this command from a directory other than the source directory.
    You will get the following error:

    abort: cannot read tags from git-repo4/.git

    Confirmed with git 1.7.9 and Mercurial 2.6.2 on Windows XP

    You may want to look at the utility: a Git plugin for Mercurial

    This plugin is originally developped by the guys of GitHub, and allows the convert from git<->mercurial losslessly. In theory, you could even be able to clone the hg repository.

    Distributed revision control with Mercurial states:

    The revision control tools supported
    by convert are as follows:

    • Subversion
    • CVS
    • Git
    • Darcs

    So maybe you don’t need any additional tool?

    The convert extension may work for you, but if it doesn’t, you might want to check out tailor which is a general purpose tool for converting among the various distributed SCMs.

    You could just not convert it at all. Just use the Hg-Git plugin! No one will know the difference.

    New player in town: git-remote-hg. It provides native bridging support in git.


    hg init ../hgrepo
    git push hg::$PWD/../hgrepo

    In the Git folder with all my Git repositories I created the Git2Hg.cmd file with the following content:

    set PATH=%PATH%;C:\Program Files\TortoiseHg
    set PATH=%PATH%;C:\Program Files\Git\bin
    hg convert %1

    Now I can convert a Git repository to Hg by typing this in a CMD:

    Git2Hg "Folder Name"

    Hg-Git Plugin or if u use for windows or migration from one to another visit here 2[Windows GIT]

    Git Baby is a git and github fan, let's start git clone.