BlackDog Foundry Bookmark This page

Moving Repository from Bitbucket to GitHub

I wanted to move one of my public repositories from Bitbucket to GitHub and was a bit uncertain as to the sequence of git commands that I would need to do.

After a little bit of research, it turns out that it is quite simple and I thought I’d capture the process here in case it helps someone else.

In this case, I had a fully up-to-date copy of the project repository in my $HOME/dev/Pipelines directory.

cd $HOME/dev/Pipelines
git remote rename origin bitbucket
git remote add origin
git push origin master

Once I was happy that the push had been successful to GitHub, I could delete the old remote by issuing:

git remote rm bitbucket

And that is it! Pretty straightforward in the end.


  1. Thanks. It really helped. This is exactly what I wanted to do! :)

  2. Lucas says:

    Thanks, it worked perfectly!

  3. Adrian says:

    Exactly the steps I was looking for! I was hesitant to do ‘git remote rm bitbucket’ as I thought that might delete the remote (origin) repository. A little research indicated that it only removes it from my local reference and does not delete the origin repository.

  4. Michael says:

    This was hugely helpful and super simple. Thank you!

  5. Jay Khimani says:

    Thanks for sharing this nice little neat trick.

  6. Nojaf says:

    Thanks, worked like a charm!

  7. Chris Brasington says:

    Fantastic, exactly what I needed.

  8. Doug says:

    Many thanks for this. Dumb question: Does the project need to already exist on GitHub or will the push create a new repository?


  9. nik says:

    thanks, nice post.

    I’d add that you need to create that new repo on Github before you do this.

Leave a Comment »


Copyright © 2012 BlackDog Foundry