Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forking an hg repo from BitBucket into a GitHub repo

Tags:

What's the quickest way to clone/fork a Mercurial repo from BitBucket to a Git repo in GitHub?

I'm aware that I can clone to a local repo, convert to git and then push to a new GitHub repo. Let's call this the manual way of doing this. I'm also aware that this isn't really a "fork" since the two repos aren't connected in any way. That's fine with me, I just want to be able to use this repo as a submodule and don't care that much about being able to send pull requests to the original hg project. I'm just wondering if there's some tool to automate this process. A kind of BitBucket-Git clone tool.

like image 264
Assaf Lavie Avatar asked Mar 11 '11 11:03

Assaf Lavie


People also ask

Is forking legal in GitHub?

The TOS states you agree to allow viewing and forking. It doesn't state that you agree to allow redistribution or use. If the terms don't explicitly state that you allow those things, then unless your license allows them they aren't allowed.


1 Answers

Well, there's the hg-git plugin that you could use. It allows you to use hg to talk to a git server. With the plugin, you could simply pull from the repository on Bitbucket and push to the repository on Github using Mercurial.

As described on the plugin homepage, this process is lossless, so it's possible to work with the Github repository as if it was just another Mercurial repository. Obviously, the Github/Bitbucket web interfaces still won't integrate with one another tough.

On a personal sidenote, I really wish Github/Bitbucket would somehow be able interoperate, but I guess that is wishful thinking ;-).

like image 170
Cedric Avatar answered Oct 06 '22 23:10

Cedric