Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is this branch tracking (if anything) in git?

After creating a branch with --track (or leaving the default, or --notrack), you later wish to be reminded of what a branch is tracking. Is there a way, other than searching through the .git/config file, to display what a branch is tracking?

like image 328
Vincent Scheib Avatar asked Sep 02 '10 22:09

Vincent Scheib


3 Answers

Use: git branch -vv to see which branches are tracked and which are not.

like image 74
slebetman Avatar answered Oct 13 '22 17:10

slebetman


Note that with git1.8.3 (April 22d, 2013), you have a new way to emphasize the upstream branch:

"git branch -vv" learned to paint the name of the branch it integrates with in a different color (color.branch.upstream, which defaults to blue).

C:\prog\git\git>git branch -vv
* master 118f60e [origin/master] Sync with maint
                  ^^^^^^^^^^^^^
                       |
                       --- now in blue
like image 8
VonC Avatar answered Oct 13 '22 15:10

VonC


If you want to know for a given branch, you could do:

git config --get branch.<branch>.remote

If it prints a remote, it's tracking something. If it prints nothing and returns failure, it's not.

like image 7
Cascabel Avatar answered Oct 13 '22 16:10

Cascabel