Mover repo do bitbucket para o github

O caminho mais curto …

Edite o URL do branch [remote “origin”] , crie o repositório github e envie:

# this
[remote "origin"]
url
= ssh://git@bitbucket.org/jbowles/learning-nodejs.git
fetch
= +refs/heads/*:refs/remotes/origin/*
#to this

[remote "origin"]

url = git@github.com:jbowles/learning-nodejs.git

fetch = +refs/heads/*:refs/remotes/origin/*


$git push -u origin master

O longo caminho

Abra .git / config e exclua branch [remote “origin”]:

$vim .git/config

Para que este:

[core]
repositoryformatversion
= 0
filemode
= true
bare
= false
logallrefupdates
= true
ignorecase
= true
[remote "origin"]
url
= ssh://git@bitbucket.org/jbowles/learning-nodejs.git
fetch
= +refs/heads/*:refs/remotes/origin/*
[branch "master"]

remote = origin

merge = refs/heads/master

rebase = true

se parece com isso

[core]
repositoryformatversion
= 0
filemode
= true
bare
= false
logallrefupdates
= true
ignorecase
= true
[branch "master"]
remote
= origin
merge
= refs/heads/master
rebase
= true

Crie um repo no Github e quando chegar a hora de adicionar a origem remota, faça:

$git remote add origin git@github.com:jbowles/learning-nodejs.git

e seu .git / config deve ser assim:

[core]
repositoryformatversion
= 0
filemode
= true
bare
= false
logallrefupdates
= true
ignorecase
= true
[branch "master"]
remote
= origin
merge
= refs/heads/master
rebase
= true
[remote "origin"]
url
= git@github.com:jbowles/learning-nodejs.git
fetch
= +refs/heads/*:refs/remotes/origin/*

Em seguida, pressione:

$git push -u origin master