title: Get the short Git version hash
body: <p>Is there a cleaner way to get the short version hash of <code>HEAD</code> from Git?</p>
  
  <p>I want to see the same output as I get from:</p>
  
  <pre><code> git log -n 1 | head -n 1 | sed -e 's/^commit //' | head -c 8
  </code></pre>
  
  <hr>
  
  <p>I originally used the above command to generate a version string, but this is even better:</p>
  
  <pre><code>git describe --tags
  </code></pre>
  
  <p>It will output strings like <code>0.1.12</code> (tagged commit) or <code>0.1.11-5-g0c85fbc</code> (five commits after the tag).</p>