Borek Bernard
Borek Bernard

Reputation: 53231

Is migration from Mercurial to Git and back effortless?

I'm trying to decide between Git and Mercurial and whatever decision I make, I'd like to know how difficult is to move from one SCM to the other.

I know there are export + import options in both tools, I'd just like to know if it will preserve things like branches, tags etc. Also, will there be other implications like broken references to commits from bug tracker etc.?

Upvotes: 4

Views: 636

Answers (2)

Lazy Badger
Lazy Badger

Reputation: 97282

While Git and Mercurial are common in roots, they have some significant differences

  • Git uses own jargon, which doesn't exist (in big part) or the same terms have different meaning in the DVCS-world, you have to adopt to these changes on switching between VCS
  • For the data model: Mercurial store more metadata in repo, compared to Git, so - if you convert repositories from one SCM to another and back, Mercurial -> Git -> Mercurial and Git -> Mercurial -> Git will show you different results on comparing repos from Step1 and Step3. GMG path save all data as is, for MGM you'll discover some data-loss in final Mercurial repo
  • Mercurial have more matured GUIs in Windows-world, than more CLI-centric Git

Upvotes: 0

Martin Geisler
Martin Geisler

Reputation: 73758

Let me answer your two questions:

  • It can be mostly effortless to map between the two systems since their underlying models are very similar. However, there are a few things that cannot be mapped back and forth. Two examples: names branches in Mercurial have no direct equivalent in Git, and Git octopus merges are not supported by Mercurial.

    There are tools like hg-git that do a very good job of letting you use Mercurial as a client for a Git repository. It's a two-way bridge between the systems and this means that you can use it to convert in both directions. It works well for a lot of people and will preserve things like tags and branches.

  • Yes, there will be broken references from external tools — though both tools use SHA-1 to generate the changeset hashes, they has different things and so come up with different IDs for changesets that should otherwise be the same.

Upvotes: 7

Related Questions