From: David Kågedal Date: Tue, 27 Apr 2010 06:35:51 GMT Subject: Re: [PATCH v2] git checkout -b: unparent the new branch with -o Message-ID: <874oixe720.fsf@krank.kagedal.org> In-Reply-To: <36ca99e91003112340u6256ef4dwb40e308c9a5e3a46@mail.gmail.com> Bert Wesarg writes: > On Fri, Mar 12, 2010 at 07:53, Junio C Hamano wrote: >> Erick Mattos writes: >>> +     test "alpha" = "$(git branch | sed -n "/*/s/\* //p")" && >> >> Don't read from "git branch" in scripts; use symbolic-ref on HEAD. > > I think what he wants is: > > git rev-parse --abbrev-ref HEAD Aha! That's a command I've been looking for a number of times. Thanks a lot for the tip. -- David Kågedal