Re: master^ is not a local branch -- huh?!?
- From
Mark Lodato <lodatom@gmail.com>
- Date
- Jan 30, 2010, 02:40 UTC
- Message-ID
- <ca433831001291840o751fa02eve1ae301537674325@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.2.00.1001292013150.1681@xanadu.home>
On Fri, Jan 29, 2010 at 8:22 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
Show 5 quoted lines
> On Fri, 29 Jan 2010, Mark Lodato wrote: > >> Still, I find it slightly confusing and unfriendly. How about the following? > > It is slightly inaccurate.
Is the following the only inaccuracy? Do you have any other feedback?
Show 12 quoted lines
>> Checking out commit 'master^0'. >> >> Since this is not a local branch head, any commits you make will be lost >> when you check out another branch or commit. (In git terminology, HEAD >> is detached.) If you just wish to look at files without committing, >> this is fine. If you wish to make commits and retain them, you may >> create a new branch by running: >> >> git checkout -b <new_branch_name> > > This gives the impression that any commit you make on a detached HEAD > are going to be lost, unless you create a new branch first.
What about "...you may want to create..."? This does not imply that creating a new branch now is the *only* way, just the most likely. If a user knows another way, that user probably does not need this warning in the first place.