title: How can I fast-forward a single git commit, programmatically?
body: <p>I periodically get message from git that look like this:</p>
  
  <pre><code>Your branch is behind the tracked remote branch 'local-master/master' 
  by 3 commits, and can be fast-forwarded.
  </code></pre>
  
  <p>I would like to be able to write commands in a shell script that can do the following:</p>
  
  <ol>
  <li><p>How can I tell if my current branch can be fast-forwarded from the remote branch it is tracking?</p></li>
  <li><p>How can I tell how many commits "behind" my branch is?</p></li>
  <li><p>How can I fast-forward by just <em>one</em> commit, so that for example, my local branch would go from "behind by 3 commits" to "behind by 2 commits"?</p></li>
  </ol>
  
  <p>(For those who are interested, I am trying to put together a quality git/darcs mirror.)</p>