Mercurial to Git
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.
Mercurial to Git
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:
- get fast-export:
git clone git://repo.or.cz/fast-export.git /tmp/fast-export
- create the new git repo and cd into it:
git init new-repo; cd new-repo
- Import the hg repo:
/tmp/fast-export/hg-fast-export.sh -r path-of-hg-repo
- Checkout master:
git checkout master
- Optional: Convert your .hgignore to .gitignore. Mostly
git mv .hgignore .gitignore
and remove thesyntax: glob
from the top. If you’ve used regular expressions, you have to fix them by hand.
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.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK