-
Star
(568)
You must be signed in to star a gist -
Fork
(101)
You must be signed in to fork a gist
-
-
Save mandiwise/5954bbb2e95c011885ff to your computer and use it in GitHub Desktop.
// 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 |
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!
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
+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.
Give this guy a nobel prize 🙌