views:

400

answers:

2

Is there an efficient workflow to mirror a project that is mainly hosted on bitbucket, to github?

+4  A: 

You could use a tool like hg-git to:

  • setup a Git repository somewhere that you have push access to,
  • and then run hg push [path] from within your project. For example:
$ cd hg-git # (a Mercurial repository)
$ hg bookmark -r default master # make a bookmark of master for default, so a ref gets created
$ hg push git+ssh://[email protected]/schacon/hg-git.git
$ hg push

This will convert all our Mercurial data into Git objects and push them up to the Git server.
You can also put that path in the [paths] section of .hg/hgrc and then push to it by name.

alt text

VonC
Thanks. I did take a brief look at hg-git, but I see that it is still in an alpha state. I tried installing it in cygwin but I am having some stability issue with it at the moment.Provided this works, though, it is definitely a useful tool in the workflow.
Santa