Hello,

this is because checkout -b sets up a so called tracking branch. Tracking
branches, among other things, have a feature that whenever you do a git
push, the commits on your local branch will be pushed to the tracking
remote; in your case, to origin/master.

What you should do is to ask Git to create a dev branch on your remote, and
to set it as the remote tracking branch to avoid later confusion:

$ git push -u origin dev

This will:
1) Update your local dev branch, setting its remote tracking to origin/dev
2) Push your commits from dev to origin/dev

To check the current tracking branch,you can simply use git status. Another
useful command, especially if you create a new branch for each feature, is
git branch -v which lists all your branches with their remote tracking
branches.

Best,
Gergely
On 27 Feb 2015 21:00, "Michael J. Mahony" <mmah...@gmail.com> wrote:

> I am developing a web application and I am using GitHub to store my source
> code. I set up a repository and have a MASTER branch.
>
> I am fairly new to using Git and wanted to use this as a learning process.
>
> Because I am using this as a learning process for using Git, I have some
> questions.
>
> I got my MASTER branch to a point where it was stable and now I want to
> start doing some serious development. I had an up to date copy of MASTER on
> my machine. I used bash and issued this command to create a DEV branch:
>
> git checkout -b dev origin/master
>
> Now when I do:
>
> git branch -a
>
> I see this list:
>
>
> <https://lh4.googleusercontent.com/-VBQZzyatwg4/VPCrRu25bVI/AAAAAAAANGM/W0ExjjkVNmU/s1600/git-branches.PNG>
>
> I have also pushed this "dev" branch. However, on GitHub it only shows one
> branch--MASTER
>
> How can I get the other branch to be on GitHub so that I can grab it from
> another machine when required?
>
>
> Can someone explain to me how to accomplish this so that I am able to have
> a branch for dev?
>
> Thanks!
>
> Mike
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to