Making corrections from Mercurial to Git?

I would like to unlock the Git repository, convert it to Mercurial, and make my changes back to the original Git repository when done. I'm more interested in a safe and stable conversion process than its convenience. I will pull change from Git to Mercurial on a regular basis, but rarely make any changes back.

I am not comfortable using hg-git because many of the errors reported against the project have remained unanswered for many years. I suspect it is safer to use hg convert to convert Git to Hg than using hg-git .

My question is: let's say I already converted the repository to Mercurial and made some changes, how do I make these changes back to the official repository? I would like to make my changes back to the official Git repository without losing history information (i.e. I don’t want to dump multiple sets of changes into one).

What is the easiest and safest way to do this?

+6
source share
1 answer

You can try and export your Mercurial as patches:

 hg export --git -r 1 >patch.diff 

This .diff file must be recognized by Git and can be added to the Git repository with git apply .
(This was suggested in the Convert Mercurial Repository to Git section, where the more modern script is hg-fast-export )

The --git hg export option ensures that you create diff in Git extended diff format. See hg help diffs .

+6
source

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


All Articles