I recently moved my projects from bitbucket to github. I have absolutely no reason to move other than checking out github.

Below are the steps that I used to move my repos:
1. Create an empty git repo in both github as well as bitbucket for the merucrial repo in bitbucket that you want to migrate.

2. Enable hg-git tool and commit to the newly created git repo in bitbucket.

Say for example, your mericurial repo is foo and and git repo is foo-git, the command would look like this:
C:\Personal\Projects\foo>hg push git+ssh://git@bitbucket.org:abhirama/foo-git.git

3. Now create a folder called foo and clone the bitbucket git repo to this folder.
C:\Personal\Projects\git>git clone https://abhirama@bitbucket.org/abhirama/foo-git.git .\foo

4. Merge changes from github repo foo to the repo foo cloned from bitbucket.
C:\Personal\Projects\git\foo [master]> git pull git@github.com:abhirama/foo.git

5. Once, done, change the origin of this repo from bitbucket to github.
C:\Personal\Projects\git\foo [master]> git remote rm origin
C:\Personal\Projects\git\foo [master]> git remote add origin git@github.com:abhirama/foo.git

6. Now push this repo to github.
C:\Personal\Projects\git\foo [master]> git push –set-upstream origin master

Voila, your repo is in github now :).

Advertisements