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

Re: [usability bug] git branch -a does not disambiguate remote and local branches

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Dec 16, 2008, 06:26 UTC
Message-ID
<20081216062634.GB3684@atjola.homenet>
In-Reply-To
<85647ef50812151015t4d5bc2b8p4ea53a0e4ad25e64@mail.gmail.com>
On 2008.12.15 21:15:15 +0300, Constantine Plotnikov wrote:
Show 8 quoted lines
> After this scenario is executed, git branch -a will give the following output:
>   master
> * origin/master
>   origin/master
> 
> Note that there is two origin/master entries, but it is not clear
> which is remote is and which is the local. I think that "git branch
> -a" should print unambiguous names, qualifying them if needed.

Actually, it is clear. The one with the * is the local one. The remote tracking branch will never be marked as checked out, as you would get a detached HEAD when you do "git checkout remotes/origin/master".

When there are duplicate entries, you can be sure that you have a local branch head and a remote tracking branch with the same shortname. And when one of them has been marked as checked out, you can be sure that it is the local one.

Björn
Previous: Lars Hjemli
Message 6 of 6 in “[usability bug] git branch -a does not disambiguate remote and local branches”
  1. Constantine PlotnikovDec 15, 2008
  2. Johannes SchindelinDec 15, 2008
  3. Constantine PlotnikovDec 15, 2008
  4. Boyd Stephen Smith Jr.Dec 15, 2008
  5. Lars HjemliDec 15, 2008
  6. Björn SteinbrinkDec 16, 2008

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.