Quantcast
Channel: How can I see which Git branches are tracking which remote / upstream branch? - Stack Overflow
Browsing latest articles
Browse All 13 View Live

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 Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

How 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 Article

Answer 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

Browsing latest articles
Browse All 13 View Live