On Wed, 25 May 2016 20:41:46 +0300
Konstantin Khomoutov <flatw...@users.sourceforge.net> wrote:

> >   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.

To make this bit more clear: any Git repository -- even a bare one
(typically used to host "shared" repositories on servers) -- contains
that famous "HEAD" ref.  In a "normal" repository -- your local one,
which you use to develop the HEAD ref points to the branch which is
checked out [*], and in a bare repository it has similar purpose: it
indicates which branch should be considered by that repository's
cloners as "the mainline".  In 99% of cases in bare repos HEAD points to
the branch "master", and that's why you run `git clone` you typically
end up with a branch "master" created: the source repo told your Git
that branch is the mainline.

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