Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I found an open-source project which is available via hg only.

Now I want to put it onto GitHub, with my own changes alongside the previous commit history.

Hg-git allows you to use git commands to push to hg (Mercurial).

What allows me to push hg to git?

share|improve this question
    
If you want to collaborate with said project, better use mercurial natively. Anything else will sooner or later become a headache for you, and get the others angry with the "outsider who just won't do things the civilized way". (I'm a big git fan myself, BTW). –  vonbrand Mar 1 '13 at 17:38

2 Answers 2

Setup your environment (once Python 2.7.*+Mercurial 2.2 are installed)

git clone http://github.com/offbytwo/git-hg
cd git-hg
git submodule update --init
cp git-hg/bin/git-hg /usr/local/bin/git-hg
cp -r git-hg/fast-export /usr/local/fast-export

Clone your hg repo

git-hg clone http://bitbucket.org/codeimpossible/artigo artigo-git

Push that to Github (or other git host)

git remote add github http://github.com/codeimposible/Artigo.git
git push github master

Reference: http://codeimpossible.com/2011/12/29/Moving-your-mercurial-repository-to-git/

share|improve this answer
    
For windows, you want to go here mercurial.selenic.com/wiki/Download and download the python version of the binary installer. The link will be Mercurial-2.8.1 (32-bit py2.7) or whatever the current version is. You will also need to install Python 2.7 –  joe.feser Jan 9 at 4:58

Side note (unrelated):

Hg-git allows you to use git commands to push to hg

is wrong impression - hg-git allow Mercurial client interact (bidirectionally) with remote Git-reposiory and can be used (if you have Mercurial) - pull from hg + push to Git

Git (client) - Hg (repository) communication can be implemented in more Git-way with Bridge support in git for mercurial and bazaar (git-remote-hg for your needs)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.