views:

4095

answers:

7

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?

If I tried googling "convert git to hg" and every search hit is about converting from git to hg. I'm also using TortoiseHg.

+4  A: 

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?

Bombe
Unfortunately "hg convert" is not available in tortoisehg
Spoike
+10  A: 

By using the Mercurial Convert extension and typing a

hg convert --datesort src dst

(even though it can lead to some issues...)

VonC
Thank you for the edit, Pat.
VonC
A: 

use this (the hg convert utility)

+18  A: 

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.

[extensions]
hgext.convert=

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.

Spoike
+5  A: 

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.

Luke Francl
A: 

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

DoxaLogos
+1  A: 

You may want to look at the http://hg-git.github.com/ utility: a Git plugin for Mercurial

vdboor