Hg2github is a project mainly written in ..., it's free.
A script and framework for setting up synchronization of mercurial repositories to github
This directory contains a small pile of scripts and instructions to stand up automatic synchronization from some number of mercurial repositories to some number of repositories on github.
The config.json file that lives here specifies both the sources and destinations of the syncing.
In order to put this script to use, you need to do the following:
You can copy config.json.example to config.json and sprinkle the following in the file:
gh_user
- the github user that you will authenticate asgh_token
- the authentication token of gh_user (from github)gh_ssh_alias
- an ssh alias that will be used to connect over ssh for
pushing changes (see discussion below)gh_tgt_acct
- the target account where you'd like repositories to
reside (may differ from gh_user when gh_user is a member of an organization.repos
a map of repository descriptions, mapping the name to an object
containing desription, src hg url, destination, and homepage. Destination
and homepage contain information that will initially be used to create repositories,
and may changed later via github's apiIn order to allow ssh to authenticate to github, you must generate a keypair, and upload the public key to github to allow you to be recognized. The private part of this keypair should be reasonably secured. Simply:
ssh-keygen -t rsa -f id_rsa
For proper ssh authentication (and to let github authenticate you and associated
you with a user account), you must set up an alias in your .ssh/config
file. That
alias should then be named in config.json, as mentioned above. Here is a sample
alias:
Host github-alias
HostName github.com
User git
IdentityFile /Users/lth/dev/hg2github/id_rsa
NOTE: IdentityFile is a path to the private key generated above.
syncit.py
script should push to the correct
location.error: refusing to create funny ref 'refs/tags/last change before major code purge/reorg' remotely
A solution is to grab the patch from this fork of hg-git:
git://github.com/lloyd/hg-git