- Add temporary github remote
git remote add github git@github.com:github_account_name/repository_name.git
- Push to github
git push github -u
- Push unmerged branches
for branch in $(git branch -r --no-merged | sed -E 's/origin\/(.*)/\1/'); do git push github origin/`echo $branch`:refs/heads/`echo $branch`; done
- Remove temporary github remote
git remote remove github
- Change origin to github (must be executed in every local repository)
git remote remove origin && git remote add origin git@github.com:github_account_name/repository_name.git