Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mirroring a HG project from Bitbucket to Github

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

like image 598
Santa Avatar asked Apr 19 '10 19:04

Santa


People also ask

How do I mirror a Bitbucket repo?

Navigate to the repository in Bitbucket. Click the Clone button. Use the Clone from dropdown to select the mirror closest to you – different mirrors have different clone URLs. Copy the clone URL (for either SSH or HTTPS).


1 Answers

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.

hg-git

like image 165
VonC Avatar answered Sep 20 '22 11:09

VonC