Converting Mercurial folder to a Git repository

后端 未结 9 2069
情话喂你
情话喂你 2020-12-04 05:21

I don\'t have a huge experience with Mercurial, I\'m mostly a Git guy.

I would love to mirror a specific Mercurial folder/file in a git Repository. What I\'m actuall

9条回答
  •  青春惊慌失措
    2020-12-04 06:02

    Maybe it helps someone today (when converting a mercurial repository to git, while retaining history). Tested to work with mercurial 4.0.1.

    ~$ git clone https://*old_hg_repo*
    ~$ git clone https://github.com/frej/fast-export.git
    ~$ cd fast-export
    ~$ git checkout tags/v180317
    ~$ cd ..
    ~$ mkdir new_git_repo
    ~$ cd new_git_repo
    ~$ git init
    ~$ .../fast-export/hg-fast-export.sh -r ../old_hg_repo/ --force
    ~$ git checkout HEAD
    

    And finally to push your newly converted local repo.

    ~$ git push REMOTE '*:*'
    

提交回复
热议问题