Answer by MJeremy for How can I see which Git branches are tracking which...
Here is a neat and simple one. Can check git remote -v, which shows you all the origin and upstream of current branch.
View ArticleAnswer by masukomi for How can I see which Git branches are tracking which...
git config --get-regexp "branch\.$current_branch\.remote"will give you the name of the remote that is being trackedgit config --get-regexp "branch\.$current_branch\.merge"will give you the name of the...
View ArticleAnswer by Aurélien for How can I see which Git branches are tracking which...
git for-each-ref --format='%(refname:short) <- %(upstream:short)' refs/headswill show a line for each local branch. A tracking branch will look like:master <- origin/masterA non-tracking one will...
View ArticleAnswer by Eugene Yarmash for How can I see which Git branches are tracking...
For the current branch, you could also say git checkout (w/o any branch). This is a no-op with a side-effects to show the tracking information, if exists, for the current branch.$ git checkout Your...
View ArticleAnswer by cdunn2001 for How can I see which Git branches are tracking which...
For the current branch, here are two good choices:% git rev-parse --abbrev-ref --symbolic-full-name @{u}origin/mainlineor% git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q...
View ArticleAnswer by Carl Suster for How can I see which Git branches are tracking which...
If you look at the man page for git-rev-parse, you'll see the following syntax is described:<branchname>@{upstream}, e.g. master@{upstream}, @{u}The suffix @{upstream} to a branchname (short...
View ArticleAnswer by albfan for How can I see which Git branches are tracking which...
Based on Olivier Refalo's answerif [ $# -eq 2 ] then echo "Setting tracking for branch " $1 " -> " $2 git branch --set-upstream $1 $2else echo "-- Local --" git for-each-ref --shell --format="[...
View ArticleAnswer by Olivier Refalo for How can I see which Git branches are tracking...
I use this aliasgit config --global alias.track '!f() { ([ $# -eq 2 ] && ( echo "Setting tracking for branch " $1 " -> " $2;git branch --set-upstream $1 $2; ) || ( git for-each-ref...
View ArticleAnswer by Cascabel for How can I see which Git branches are tracking which...
Very much a porcelain command, not good if you want this for scripting:git branch -vv # doubly verbose!Note that with git 1.8.3, that upstream branch is displayed in blue (see "What is this branch...
View ArticleAnswer by Abizern for How can I see which Git branches are tracking which...
An alternative to kubi's answer is to have a look at the .git/config file which shows the local repository configuration:cat .git/config
View ArticleAnswer by kubi for How can I see which Git branches are tracking which remote...
git remote show originReplace 'origin' with whatever the name of your remote is.
View ArticleHow can I see which Git branches are tracking which remote / upstream branch?
I know I can do git branch --all, and that shows me both local and remote branches, but it's not that useful in showing me the relationships between them.How do I list branches in a way that shows...
View ArticleAnswer by Jimmix for How can I see which Git branches are tracking which...
Get info about all remotes, branches and tracking:for remote in $(git remote show -n); do git remote show -n "${remote:?}"; doneor get just names of remotes with their urlgit remote -v show -n
View Article