Moving from Mercurial to Git and back effortlessly?

I am trying to decide between Git and Mercurial and any solution I make, I would like to know how difficult it is to switch from one SCM to another.

I know that both tools have export and import options, I would just like to know if it will save things like branches, tags, etc. There will also be other consequences, such as broken links to commits with an error debugger, etc.

+4
source share
2 answers

Let me answer your two questions:

  • In most cases, you can easily match the two systems, because their basic models are very similar. However, there are a few things that cannot be matched back and forth. Two examples: name branches in Mercurial do not have a direct equivalent in Git, and Git merges octopus are not supported by Mercurial.

    There are tools like hg-git that very well allow you to use Mercurial as a client for the Git repository. This is a two-way bridge between systems, which means that you can use it to convert in both directions. It works well for many people and preserves things like tags and branches.

  • Yes, there will be links to external tools - although both tools use SHA-1 to generate change hashes, they have different things and therefore come with different identifiers for sets of changes that otherwise should be the same.

+7
source

While Git and Mercurial are common to the roots, they have some significant differences.

  • Git uses its own jargon that does not exist (in large ), or the same terms have different meanings in the DVCS world, you must accept these changes when switching between VCS
  • For the data model: Mercurial stores more metadata in the repo than Git, so if you convert repositories from one SCM to another and vice versa, Mercurial β†’ Git β†’ Mercurial and Git β†’ Mercurial β†’ Git will show you different results when comparing repositories with Step1 and Step3. GMG path save all data as is, for MGM you will find data loss in the latest Mercurial repository
  • Mercurial has more mature GUIs in the Windows world than more CLI-oriented Git
0
source

Source: https://habr.com/ru/post/1386300/


All Articles