35

Mercurial to Git

 3 years ago
source link: https://hynek.me/articles/mercurial-to-git/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Mercurial to Git

10 May 2011

Mostly a note to myself as I forget it regularly.

The best way known to me to convert a Mercurial (hg) repo into a Git one is:

  1. get fast-export: git clone git://repo.or.cz/fast-export.git /tmp/fast-export
  2. create the new git repo and cd into it: git init new-repo; cd new-repo
  3. Import the hg repo: /tmp/fast-export/hg-fast-export.sh -r path-of-hg-repo
  4. Checkout master: git checkout master
  5. Optional: Convert your .hgignore to .gitignore. Mostly git mv .hgignore .gitignore and remove the syntax: glob from the top. If you’ve used regular expressions, you have to fix them by hand.

Hynek Schlawack

Hynek Schlawack

In ♥ with 🇪🇺, Python, Go, and networks. Blogger, speaker, PSF fellow, part-time beach bum.

Is my content helpful and/or enjoyable to you? Please consider supporting me! Every bit helps to motivate me in creating more. You can also buy me a coffee on Ko-fi – starting at 3 € and no account required.

If you speak German, please consider getting your domains and web hosting from my employer Variomedia. Without their support my community output would be considerably smaller.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK