Skip to content

Instantly share code, notes, and snippets.

@mandiwise
Last active December 20, 2025 18:28
Show Gist options
  • Select an option

  • Save mandiwise/5954bbb2e95c011885ff to your computer and use it in GitHub Desktop.

Select an option

Save mandiwise/5954bbb2e95c011885ff to your computer and use it in GitHub Desktop.
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@jpgarza93
Copy link

jpgarza93 commented Oct 8, 2024

If you're using bitbucket make sure the login is whatever it says in your https://bitbucket.org/account (not your email address) and generate an app password, that worked for me.

Give this guy a nobel prize 🙌

@prennings
Copy link

If you're using bitbucket make sure the login is whatever it says in your https://bitbucket.org/account (not your email address) and generate an app password, that worked for me.

What @jpgarza93 said, give the man a nobel prize! I was pulling my hair out why it failed! Worked as a charm after this comment!

@pedrocganem
Copy link

If you're using bitbucket make sure the login is whatever it says in your https://bitbucket.org/account (not your email address) and generate an app password, that worked for me.

+1, tysm

@johnscott999
Copy link

+1, this did most of what I needed.

My local branch had trouble tracking after this, though that might be because I wanted to rename the trunk branch from master to main while I was doing this, so I also had to run

$ git branch -u origin/main

after setting up the new origin to get the branch to track.

@deependudhe
Copy link

Thanks!

@drmrbrewer
Copy link

Works nicely, but if you have e.g. 100 repos to migrate from bitbucket into GitHub, I assume this import tool can only do this one at a time? Is there an equivalent API / automated import?

@azygis
Copy link

azygis commented Dec 20, 2025

At least for me, it was no longer possible to migrate using GitHub importer. Perhaps because the authentication is now using API tokens and no longer App passwords, no idea, it just throws "something went wrong" with no clear explanation of what was wrong. Resorted to as simple as

git clone <bitbucket url>
git remote add github <github url>
git push github --all
git push github --tags

In my case I just needed to migrate because of the recent email of Atlassian removing the repositories. A bit more painful for "more repositories", but surely it would be pretty easy to automate yourself, including ability to handle 100 or whatever amount of repos.

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