Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barseghyanartur/d29c35e95973899e863f50523a922ef6 to your computer and use it in GitHub Desktop.
Save barseghyanartur/d29c35e95973899e863f50523a922ef6 to your computer and use it in GitHub Desktop.
BitBucket Mercurial to Git transition idea

There is an official python-hglib, there's also an awesome GitPython and there's also fast-export (recommended by GitHub). If one would simply combine the three (and get lots of lots of kudos), that would be simply awesome.

Expected usage (from terminal):

hg-to-git --username={USERNAME} --repository={REPONAME} --suffix={SUFFIX}

So that it would:

  • Use localy RSA keys (if available, which can be the default case)
  • Keep the level of privacy (which means, if repository has been private, keep it private).
  • Clone repo (into some temporary dir).
  • Convert repo to Git.
  • Push repo to same account, keeping same name, only appending the given suffix.

Just one command to do all the work. Or even better (the best case), just provide your username and let ALL mercurial repos converted to Git.

hg-to-git-all --username={USERNAME} --suffix={SUFFIX}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment