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

Re: "git branch" to list whether it's tracking remote branch?

From
DSDirk Süsserott <newsletter@dirk.my1.cc>
Date
Jun 14, 2011, 13:57 UTC
Message-ID
<4DF768C2.2050001@dirk.my1.cc>
In-Reply-To
<934599.4947.qm@web121018.mail.ne1.yahoo.com>
Hi Jason,
Am 14.06.2011 12:23 schrieb Jason Timrod:
Show 11 quoted lines
> Hi,
> 
> please cc me as i am not subscribed to this list.
> 
> is there a command in git that will tell me if a given topic branch in a repository is setup to track a remote branch?
> 
> i think it would be useful so i can see which branches are pointing where when i try and then do a "git push"
> 
> TIA!
> 
> Jason
you could do "git branch -avv" (especially -vv for "very verbose" :-))
---------
  docs   57dddc4 Docs: Reformatted ...
* foo    96afa77 [pub/foo] Ticket 1234 ...
---------

In the second line you can see that local branch "foo" follows "foo" in the remote "pub".

Or simply "cat .git/config" and check the "branches" sections:
---------
[branch "foo"]
        remote = pub
        merge = refs/heads/foo
---------

HTH, Dirk

Previous: Jason Timrod
Message 2 of 2 in “"git branch" to list whether it's tracking remote branch?”
  1. Jason TimrodJun 14, 2011
  2. Dirk SüsserottJun 14, 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.