title: Upstream branch not stored as remote-tracking branch
body: <p>I'm writing a git script to check updatedness for all branches.</p>
  
  <pre><code>if [[ -n $(git config --get branch.$SHORT.remote) ]]; then
      LOCAL=$(git rev-parse "$SHORT")
      REMOTE=$(git rev-parse "$SHORT"@{upstream})
      BASE=$(git merge-base "$SHORT" "$SHORT"@{upstream})
  
      if [ $LOCAL = $REMOTE ]; then
          echo "Up-to-date"
      elif [ $LOCAL = $BASE ]; then
          echo "Need to pull"
      elif [ $REMOTE = $BASE ]; then
          echo "Need to push"
      else
          echo "Diverged"
      fi
  else
      echo "No upstream configured."
  fi
  </code></pre>
  
  <p>It gives me this error (twice, once for each @{upstream}):</p>
  
  <pre><code>fatal: Upstream branch 'refs/heads/master' not stored as a remote-tracking branch
  fatal: Upstream branch 'refs/heads/master' not stored as a remote-tracking branch
  </code></pre>
  
  <p>Here is my <code>git branch -a</code>:</p>
  
  <pre><code>  master
  * scrimmage
    remotes/origin/development
    remotes/origin/master
    remotes/origin/scrimmage
    remotes/origin/scrimmage-simple
  </code></pre>
  
  <p>What?? I don't understand any of this terminology, and can't find any reference to it except in some obscure mailing list where they decided to use this error message.</p>