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

Re: Feature Request: add a --current option to git branch

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 23, 2011, 19:32 UTC
Message-ID
<AANLkTikecya+o+rLVHJARv06mCtEv-Ef1nRECQH0saLr@mail.gmail.com>
In-Reply-To
<AANLkTimDE18XK8NOg++pxqs5LCJZ4m67Ygo4JvYDbw+F@mail.gmail.com>
On Wed, Feb 23, 2011 at 2:08 PM, John Jendro <tacliat@gmail.com> wrote:
> Yes I know this can be done with sed & grep, but --current should be a
> standard thing for git branch to have.

I sense you're looking to get the name of the currently checked out branch, possibly for use in a script. In that case, you may want "git rev-parse --abbrev-ref HEAD" or "git rev-parse --symbolic-full-name HEAD" depending upon what you're trying to do.

j.
Previous: John JendroNext: Junio C Hamano
Message 2 of 3 in “Feature Request: add a --current option to git branch”
  1. John JendroFeb 23, 2011
  2. Jay SoffianFeb 23, 2011
  3. Junio C HamanoFeb 23, 2011

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.