git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] git checkout -b: unparent the new branch with -o

From
David Kågedal <davidk@lysator.liu.se>
Date
Apr 27, 2010, 06:35 UTC
Message-ID
<874oixe720.fsf@krank.kagedal.org>
In-Reply-To
<36ca99e91003112340u6256ef4dwb40e308c9a5e3a46@mail.gmail.com>
Bert Wesarg <bert.wesarg@googlemail.com> writes:
Show 9 quoted lines
> On Fri, Mar 12, 2010 at 07:53, Junio C Hamano <gitster@pobox.com> wrote:
>> Erick Mattos <erick.mattos@gmail.com> 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
Previous: Bert WesargNext: Erick Mattos
Message 4 of 17 in “git checkout -b: unparent the new branch with -o”
  1. git checkout -b: unparent the new branch with -oErick Mattos, Mar 9, 2010
  2. Junio C HamanoMar 12, 2010
  3. Bert WesargMar 12, 2010
  4. David KågedalApr 27, 2010
  5. Erick MattosMar 12, 2010
  6. Junio C HamanoMar 13, 2010
  7. Junio C HamanoMar 13, 2010
  8. Erick MattosMar 14, 2010
  9. Junio C HamanoMar 15, 2010
  10. Erick MattosMar 16, 2010
  11. Jakub NarebskiMar 13, 2010
  12. Junio C HamanoMar 13, 2010
  13. Erick MattosMar 14, 2010
  14. Junio C HamanoMar 15, 2010
  15. Erick MattosMar 16, 2010
  16. Erick MattosMar 14, 2010
  17. Erick MattosMar 14, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.