Converting a Mercurial (hg) repository to Git on Windows (7)

后端 未结 6 1640
别跟我提以往
别跟我提以往 2020-12-02 11:21

I\'m really quite frustrated at this point. I have an existing hg repository that has months of coding history in it, and I want to get this into a private Github repository

6条回答
  •  爱一瞬间的悲伤
    2020-12-02 11:57

    Everything I've read about these Hg converters for Git does point out one obvious error you've made: Using Python 3!

    Those Python errors you've been getting are due to scripts like hg-git and fast-export being built using Python 2.6. Python 3 treats "print" differently, hence your errors.

    Either rewrite the scripts to work with your version or install Python 2.6.

    Make sure to add it to your PATH setting. Same goes for when you install msysGit. Be sure you choose the second option at install to add Git to your path.

    You also need Mercurial For Python, available at TortoiseHG's thg-winbuild project:

    https://bitbucket.org/tortoisehg/thg-winbuild/downloads

    The file will be named 'mercurial-2.2.2.win-amd64-py2.6.exe' for 64-bit Windows and 'mercurial-2.2.2.win32-py2.6.exe' for 32-bit. While you're at it, get the companion Mercurial 2.2.2 installer, just in case.

    Although you stated you don't wish to install yet another VCS software, using any of these Hg converters requires Mercurial to also be installed.

    Another pitfall to look out for is these converters may not work with the latest versions of Mercurial. You might need to experiment a bit with older releases to find one that works well with the scripts.

    Be sure to carefully read through the tutorials and the Readme files for whichever converter you settle upon using. It seems a lot of your grief and trouble stems from having impatiently jumped into the deep end after only skimming the documentation.

    There are patches available that add Mercurial support to Git and msysGit, but you'll need to be comfortable with patching and compiling from source if you wish to follow that route.

提交回复
热议问题