title: In Git, list names of branches with unpushed commits
body: <p>Given a project with several local branches, each tracking some remote branch, is there a command that lists all branches that have unpushed commits? (That is, even if none of those branches are checked out.)</p>
  
  <p>I don't want to see the commits themselves, nor do I want to see branches that are up-to-date, I just want to see which branches are ahead of their remotes.</p>
  
  <p>I have tried <code>git log --branches --not --remotes --simplify-by-decoration --decorate --oneline</code>, but it doesn't seem to show what I need. Running it on my current repo gives no output, but running <code>git status</code> on my current branch shows <code>Your branch is ahead of 'origin/branchname' by 2 commits.</code></p>
  
  <p><code>git for-each-ref --format="%(refname:short) %(push:track)" refs/heads</code> and <code>git branch -v</code> both show branches that are up to date as well as ones that need pushing. However, they <em>do</em> both show my current branch as <code>[ahead 2]</code>.</p>
  
  <p>Other commands I have found eg. <code>git log @{u}..</code>, <code>git cherry -v</code> list the commits themselves, not the branches.</p>
  
  <p><strong>Side question:</strong> why would the output from <code>git log --branches --not --remotes --simplify-by-decoration --decorate --oneline</code> not include branches that <code>git branch -v</code> shows as ahead? Isn't the former command just looking at which <code>refs/heads</code> do not correspond to a known remote; so wouldn't a branch listed as <code>[ahead 2]</code> meet this criteria?</p>