Is there an efficient workflow for mirroring a project, which is mainly hosted on a bitpack using Hg, before github?
You can use a tool like hg-git to:
hg-git
set up the Git repository somewhere you click on access,and then run hg push [path] from your project. For example:
hg push [path]
$ 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.
[paths]
.hg/hgrc
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/
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
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).
Another affordable quick conversion solution: https://github.com/frej/fast-export
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:
[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.
Install dulwich, if not already: pip install dulwich .
pip install dulwich
Create a new empty repository on GitHub, for example https://github.com/user/git-mirror .
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
To do this, you can use the Git-hg Mirror service (including mirroring the GitHub repository on Bitbucket or two-way synchronization).