I have master and new-project branches. And now I\'d like to create a brand new repo with its master based on the new-project branch.
I started with @user292677's idea, and refined it to solve my problem:
$ git push https://github.com/accountname/new-repo.git +new-project:master
The new Github repo is finished. The result is;
master
corresponds to the old repo's new-project, withIn fact, I found that by using this method, I could create the new repo with a hand-picked selection of branches, renamed as I wanted:
$ git push git@github.com:accountname/new_repo +new-project:master +site3a:rails3
The result is that the pre-existing site3a branch is now also moved to the new repo and will appear as rails3. This works really well: the network diagram shows the new master and rails3 with full history and in their correct relationship to each other.
Update 2013-12-07: Used this with another project, and verified that this recipe still works.
Update 2018-01-11: Updated step 3. to use GitHub recommendation for https protocol. Recipe still works.