title: How do I get the Git commit count?
body: <p>I'd like to get the number of commits of my Git repository, a bit like SVN revision numbers.</p>
  
  <p>The goal is to use it as a unique, incrementing build number.</p>
  
  <p>I currently do like that, on Unix/Cygwin/msysGit:</p>
  
  <pre><code>git log --pretty=format:'' | wc -l
  </code></pre>
  
  <p>But I feel it's a bit of a hack.</p>
  
  <p>Is there a better way to do that? It would be cool if I actually didn't need <code>wc</code> or even Git, so it could work on a bare Windows. Just read a file or a directory structure...</p>