|// 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|
This method is only moving the master branch. I would urge you to use the github built in
You can then change your local repo to point at the new origin.
then after that you can optionally add the old remote if you have a need.
The problem with doing a
For the purpose of switching from bitbucket to github for which you won't be returning or requiring the ongoing hosting on bitbucket it would be desirable to not rename but simple reassign origin's url with the new github URL.
when I transferred my bitbucket repo to my awesome GitHub repo. I need to make a pull before pushing the code. because in new Github repo there where Initial Commit. when I tried to
As a solution, I pulled branch with --allow-unrelated-histories option.
I used a newer tutorial – making use of "upstream" and not "origin"; which seems to not do something like a fork, but chaning the real origin of the Repo: