Which command lists all the local branches that diverged from the remote branches they follow (either because the local branch has new commits or the remote one)?


2 Answers 2


Maybe try something simple in shell, such as:

for b in $(git branch -l | sed -re 's/^[ *]+//g'); do echo $b:; git diff origin/$b..$b --stat ; done

You can use git fetch to get the files from your remote (without merging), then use

git log --oneline --decorate --graph --all

and you should be able to see the most recent commits of all the various branches.

  • Thanks, but this shows the whole (long) history and leaves it to me to figure out which branch has new commits. I'd really like to only get the branches name.
    – John
    Commented Jun 18, 2015 at 17:08
  • Ignore my (now deleted) last comment. Just use 'git remote -v update' This will show you which tracked branches are not up to date.
    – barriboy
    Commented Jun 18, 2015 at 18:21
  • That command tells me that master is "[up to date]", even though it is five commits behind origin/master. :-(
    – John
    Commented Jun 18, 2015 at 19:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .