Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (32 sloc) 1.05 KB
# make sure you have no local modifications!
hg status
# git branches map to hg bookmarks
# make sure we have a branch called "master"
hg bookmark -r default master
# export all the changesets into git format
# this makes a local bare repo in .hg/git
hg gexport
# init a proper git repo
git init .
# link it to the hg-controlled one, and pull from it
git remote add mercurial .hg/git
git pull mercurial master
# add github for backing up
git remote add origin
git push origin master
# branch, edit, commit, merge, etc
# export changes from master back to hg-controlled git
git push mercurial master
hg gimport
# to create bare hg repo:
hg update null
post-pull.bookmark-sync-master = hg bookmark -f -r default master
post-pull.export-to-git = hg gexport