Re: [PATCH] tone down the detached head warning
- From
Jeff King <peff@peff.net>
- Date
- Feb 1, 2007, 03:29 UTC
- Message-ID
- <20070201032925.GA2505@coredump.intra.peff.net>
- In-Reply-To
- <7vd54ur26u.fsf@assigned-by-dhcp.cox.net>
On Wed, Jan 31, 2007 at 07:23:21PM -0800, Junio C Hamano wrote:
Show 12 quoted lines
> M foo.c > Switched to branch "master" > : gitster project/master; git checkout master^ > M bar.c > M foo.c > Detached your HEAD -- you are not on any branch. > If you want to create a new branch from this checkout, you may do so > (now or later) by using -b with the checkout command again. Example: > git checkout -b <new_branch_name> > : gitster project; > > would feel very natural and much less scary.
Much improved, IMHO. As an added bonus, I think it creates some feedback that lets a user know when they have mistakenly used 'git checkout' to switch heads when they meant to restore a file.
I still wish there was some other language for detaching to a commit specified by a remote tracking branch; it just seems wrong to say "you are not on any branch" right after the user requests to checkout a branch (admittedly not one of their local branches, but for a user merely poking through the repository, the difference is probably not important).
-Peff