From: Junio C Hamano Date: Thu, 01 Feb 2007 03:23:21 GMT Subject: Re: [PATCH] tone down the detached head warning Message-ID: <7vd54ur26u.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20070201030030.GA1979@coredump.intra.peff.net> Jeff King writes: > I think part of the "scariness" of the message is that git-checkout does > not _usually_ produce output. I wonder if, when switching HEAD, it > usually printed "Now on branch ", and for detached printed some > special variant, it would seem more natural. That sounds sensible. Another thing I found slightly annoying about branch switching in git-checkout is that we list the paths with local changes only when the tip of the old branch and the new branch are different. Very often I start hacking while on 'master' and later find the change forms a concrete "theme", and then say "git checkout -b that-theme" to switch a branch; in such a case I do want the list of locally modified paths. For example: : gitster project/master; edit foo.c : gitster project/master; git checkout -b theme M foo.c Switched to a new branch "theme" : gitster project/theme; edit bar.c : gitster project/theme; git checkout master M bar.c 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 : gitster project; would feel very natural and much less scary. Note. I run with PS1=': \h \W$(__git_ps1 "/%s"); '.