Skip to content

Instantly share code, notes, and snippets.

@mandiwise
Last active October 23, 2024 07:20
Show Gist options
  • Save mandiwise/5954bbb2e95c011885ff to your computer and use it in GitHub Desktop.
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
@arifktk32
Copy link

It worked for me, thank you @mandiwise :)

@ufcurmcginty
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.

Promote this man! This was my problem :)

@SomervilleTom
Copy link

SomervilleTom commented Feb 22, 2024

According to github importer documenation, the following is NOT imported:

  • Personal repositories owned by users
  • Branch permissions
  • Commit comments
  • Repository settings
  • CI pipelines

This makes the import tool a non-starter for me, my bitbucket repos are all private and I very much want the commit comments.

@SomervilleTom
Copy link

BTW, this thread may see more activity for awhile.. Atlassian in its wisdom has terminated support for Bitbucket Server effective 5-MAR-2024 (2 weeks from now).

@webmaster-lgc
Copy link

+1 for GitHub import tool. It's easier.

Also, in my case, I needed to create an App password in my Bitbucket account settings, and use my Bitbucket username and the created token as credentials when importing. (Read & Write)

Finally, just reset the remote url locally git remote set-url origin [email protected]:username/repo-name.git.

@SomervilleTom
Copy link

SomervilleTom commented Mar 22, 2024

FWIW, Atlassian now tells me that this was a false alarm. Once they figured out how to let me update the expiration date of my credit card, all was fine with my current Bitbucket product. I'm not going to even try to hazard a guess as to its name. The Atlassian site is among the worst I've ever tried to navigate.

@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 🙌

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