Mirroring an HG project from Bitbucket to Github

Is there an efficient workflow for mirroring a project, which is mainly hosted on a bitpack using Hg, before github?

+53
git workflow bitbucket github mercurial
Apr 19 '10 at 19:24
source share
7 answers

You can use a tool like hg-git to:

  • set up the Git repository somewhere you click on access,
  • and then run hg push [path] from 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://git@github.com/schacon/hg-git.git $ hg push 

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

hg-git

+38
Apr 19 '10 at 19:49
source share

If you use Mercurial for a project, you can quickly and easily make a git mirror of your project so that git users can contribute. I created a tutorial about using hg-git to manage Mercurial mirrors on GitHub.

It describes how to get started with a GitHub account, how to promote a project from Mercurial to GitHub, and how to accept contributions (pull requests) from GitHub. Here's a link to a blog post: http://hgtip.com/tips/advanced/2009-11-09-create-a-git-mirror/

+13
Apr 19 '10 at 20:51
source share

Add git-remote-hg to your bin path. Then you can mirror as mentioned on github .

 git clone --mirror hg::https://bitbucket_repo 

then go to your cloned repo

 git remote set-url --push origin https://github.com/exampleuser/mirrored 

finally sync your mirror

 git fetch -p origin git push --mirror 
+10
Apr 21 '14 at
source share

As of July 2013, there is a BitSyncHub web service to automate this process using the post-receive bitBucket. You will need to grant permission to write the service to your GitHub repository (add bitynchub as a contributor).

+6
Dec 6 '13 at 22:30
source share

Another affordable quick conversion solution: https://github.com/frej/fast-export

+1
Mar 23 '14 at 9:10
source share

I have been reporting since February 2019. I just ran into this problem, followed @vonc's suggestion to use hg-git, and followed some missing steps to get it working. Here I will provide a more detailed guide:

  1. Install hg-git by copying its storage and making the 'extensions' section in your ~ / .hgrc file look something like this:
 [extensions] hggit = [path-to]/hg-git/hggit 

I found the latest installation instructions in the source code repository: https://bitbucket.org/durin42/hg-git . So watch out for this.

  1. Install dulwich, if not already: pip install dulwich .

  2. Create a new empty repository on GitHub, for example https://github.com/user/git-mirror .

  3. Clone the original hg repository and put it in the git mirror:

 $ hg clone https://bitbucket.org/user/hg-source $ cd hg-source $ hg push git+ssh://git@github.com/user/git-mirror.git 
+1
Feb 03 '19 at 1:12
source share

To do this, you can use the Git-hg Mirror service (including mirroring the GitHub repository on Bitbucket or two-way synchronization).

0
May 12 '18 at 17:23
source share



All Articles