Re: master^ is not a local branch -- huh?!?
- From
- Ron Garret <ron1@flownet.com>
- Date
- Jan 30, 2010, 06:23 UTC
- Message-ID
- <ron1-E17C62.22231529012010@news.gmane.org>
- In-Reply-To
- <76718491001292052x7f46d479lfeff7b66121502c3@mail.gmail.com>
In article <76718491001292052x7f46d479lfeff7b66121502c3@mail.gmail.com>, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 26 quoted lines
> On Fri, Jan 29, 2010 at 9:59 PM, Junio C Hamano <gitster@pobox.com> wrote: > > Ron Garret <ron1@flownet.com> writes: > > > >> 1. The term "detached HEAD" is inherently misleading. A detached HEAD > >> isn't detached from anything, it's just pointing to the middle of a > >> branch, which is to say, to a commit that happens to already have > >> descendants. For that matter, the name HEAD is itself misleading, since > >> HEAD need not be the head of a branch (though normally it is). A better > >> name for HEAD would have been CURRENT or ACTIVE. I recognize it's > >> probably too late to change it now. > > > > This description, especially the phrase "middle of a branch" shows that > > you don't understand git yet. A git branch is _not_ a line (nor multiple > > lines) of development. It is merely a _point_ in the history. > > > > "A commit that is in the middle of an ancestry chain with existing > > descendants" can be at the tip of a branch and does not have anything to > > do with detached HEAD state. > > > > When HEAD points at a branch, making a commit advances _that_ branch. And > > we say you are "on that branch". When HEAD is detached, because it is not > > attached to anything, it advances no branch. "detached HEAD" is detached > > in the very real sense. It is not attached to _any_ branch. > > Let me try wording this slightly different, because I think I can see > Ron's confusion.
[snip]
> So that was a really long explanation, but I hope it clears things up.
Yes, that was very helpful, thank you.
Might it make more sense to talk about "anonymous branches" or "unnamed branches" instead of "detached heads"? I think something like the following would be much easier to grasp:
WARNING: Your HEAD is now pointing to a commit that is not a named branch head. As a result of this, any commits off of this one may be lost during the next garbage collection. If you want to prevent this, you should give this branch head a name by doing ...
rg