Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Moving a Git repository from BitBucket to GitHub


A new, empty Git Repository has to be created on (do not initialize it with a Readme or alike, when asked!)

How-to migrate Git Repository to GitHub

$ cd /path/to/project
$ git remote add upstream[account]/[repository].git
$ git push upstream master
$ git push --tags upstream


  • First, check in the target GitHub Repository that all files, commits & tags have been successfully transferred
  • Now you may disable/remove the repository on BitBucket safely
  • When using Sourcetree, edit the "Respository settings...":
    • I personally liked to remove the old Remote "origin" (from BitBucket)
    • and changed the name of the GitHub Remote from "upstream" to "origin" instead


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment