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.
And that is all. (Note: git history preserved)
I had tried the answer above and found it not specific enough as it didn't specify +master:master which is what I needed to make it work. It works great.
Source (with my modifications to avoid ssh issues with github): Mauricio Aiello, former Java Senior Developer, https://www.quora.com/How-do-I-create-a-new-GitHub-repository-from-a-branch-in-an-existing-repository