-
Create a public repo on github, you can add README or License files on the master branch, suppose the url is:
https://github.com/leetschau/don4.git
-
Get the private repo:
$ git clone https://leechau@bitbucket.org/leechau/donno.git $ cd donno $ git branch -v -a (list all remote branches for checkout) $ git checkout -b develop origin/develop (copy remote branch to local repo and update working directory)
-
Publish to github, you have 2 choices:
i. Publish selected branches:
$ git remote add don4 https://github.com/leetschau/don4.git $ git push -u don4 master $ git push -u don4 develop
or you can push your "master" branch to remote as "init" branch for avoid confliction with master branch created on github:
$ git push don4 master:init
i. Publish all branches:
$ git push --mirror https://github.com/leetschau/don4.git
In this case you can't create README or License files when creating github project, to avoid conflict on master branch.