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

Git Feature Request - show current branch

From
Mmdconf@seznam.cz <mdconf@seznam.cz>
Date
Feb 19, 2015, 13:14 UTC
Message-ID
<13b.3lxh{.41MsIT3sthY.1KvU6v@seznam.cz>
Hello,
To start with, I did not find an official way to submit feature request so hopefully this is the right way to do so - if not then my apologize & appreciate if somebody could re-submit to the proper place.
I'd like to request adding a parameter to 'git branch' that would only show the current branch (w/o the star) - i.e. the outcome should only be the name of the branch that is normally marked with the star when I do 'git branch' command. This may be very helpful in some external scripts that just simply need to know the name of the current branch. I know there are multiple ways to do this today (some described here: http://stackoverflow.com/questions/6245570/how-to-get-current-branch-name-in-git) but I really think that adding simple argument to 'git branch' would be very useful instead of forcing people to use 'workarounds'.

My suggestion is is to name the parameter '--current' or '--show-current'. Example:

Command: git branch
Outcome:
 branchA
 branchB
* master
Command: git branch --current
Outcome:
master

Thank you, Martin

Next: Randall S. Becker
Message 1 of 5 in “Git Feature Request - show current branch”
  1. mdconf@seznam.czFeb 19, 2015
  2. Randall S. BeckerFeb 19, 2015
  3. Michael J GruberFeb 19, 2015
  4. Junio C HamanoFeb 19, 2015
  5. Michael J GruberFeb 20, 2015

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.