On Wed, 25 May 2016 10:17:15 -0700 (PDT)
Derell Licht <derell.li...@gmail.com> wrote:

> I have a repository with two branches, master and develop.
> I want to make all commits to develop branch.  
> I typed "git checkout develop", but "git branch --all" still shows:
> * develop                             
>   master                              
>   remotes/origin/HEAD -> origin/master
>   remotes/origin/develop              
>   remotes/origin/master               
> I even made a change and committed/pushed, which moved develop branch
> to the new commit, but HEAD is still pointing to master.
> Every reference that I'm finding online, says that (1) checkout
> command will move HEAD to new branch, and (2) HEAD always points to
> the most recent commit.
> Why isn't any of that happening here??

That's not "HEAD is still pointing to master." but rather that's
"remotes/origin/HEAD points to origin/master" which is a completely
different thing.

The ref "remotes/origin/HEAD" records the state of the origin remote at
the time you have cloned it, and it pointed to the branch "master" as
was found in the remote repository.  The state of that branch is
captured by your clone via the so-called "remote branch" named
"origin/master", and that's what `git branch -a` is showing you.

Your HEAD ref is OK, and it points to your local branch "develop" which
is indicated by the asterisk character '*' which decorates that
branch's name.

Please read up on remote branches.  [1] should be OK.
And I highly recommend to read that whole book.

1. https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches

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