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

2 messages from 2011-06-14 to 2011-06-14. Participants: Jason Timrod, Dirk Süsserott.
Thread: https://gitlist.dev/t/27620

## Jason Timrod, 2011-06-14 10:23

Subject: "git branch" to list whether it's tracking remote branch?
Message-ID: <934599.4947.qm@web121018.mail.ne1.yahoo.com>
URL: https://gitlist.dev/e/934599.4947.qm%40web121018.mail.ne1.yahoo.com

```
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

```

## Dirk Süsserott, 2011-06-14 13:57

Subject: Re: "git branch" to list whether it's tracking remote branch?
Message-ID: <4DF768C2.2050001@dirk.my1.cc>
URL: https://gitlist.dev/e/4DF768C2.2050001%40dirk.my1.cc
In-Reply-To: <934599.4947.qm@web121018.mail.ne1.yahoo.com>

```
Hi Jason,

Am 14.06.2011 12:23 schrieb Jason Timrod:
> 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

```
