Search code examples
gitmercurial

Store nodeid when migrating from mercurial to git


I have a huge hg project, and my documents use the unique hg hash (nodeid) to specify revisions on the repository.

I want to convert the repo to git, with it's history. And I want to be able to search the original hg nodeids on the history, in the new git repo. (I think the best way will be adding it to the commit message in git).

How can I do that? Is there a conversion tool that'll do that automatically?


Solution

  • git-remote-hg allows to preserve Mercurial revisions as Git commit notes:

    git config core.notesRef refs/notes/hg
    

    Set it before conversion.