smeeb smeeb - 1 year ago 285
Git Question

How to create development branch from master on GitHub

I created a repo on GitHub and only have a

branch so far. My local working copy is completely up to date with the remote/origin
on GitHub.

I now want to create a
branch on GitHub so that other people on my team can start pushing changes to
(instead of directly to
) and submit PRs, request code reviews, etc.

So I tried creating a new
branch locally and pushing it:

git checkout -b development
git push origin development:master

But git just says
Everything up-to-date
. So I ask:

If I'm current with
, how do I just create a remote
branch that contains an exact copy of

Answer Source

When you do

$ git push origin development:master

What's actually happening is git is taking <local>:<remote> and updating <remote> to whatever the <local> branch is.

Since you executed git checkout -b development from master, your local development has all the commits master does; hence it shows as everything is up to date.

You can just do

$ git checkout -b development
$ git push origin development

to push the new branch

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download