title: Creating a .NET incrementing assembly build version in Git
body: <p>How do I write a script which will create a source file containing the version number? I would like the build number (4th number in the version quadruple) to be autoincremented for each commit.</p>
  
  <p>I found <a href="http://www.jukie.net/bart/blog/auto-git-versioning" rel="nofollow">some examples</a> on how to use bash commands to do it:</p>
  
  <pre><code>INCREMENT=`git-rev-list $BRANCH..HEAD | wc -l | awk '{print $1}'`
  </code></pre>
  
  <p>but I am using Windows and I don't have a clue how to run that as a script (or a Windows batch file). </p>
  
  <p>I used to work with SVN, and it worked nicely from the command prompt, so I just used it in a batch file, but I don't know how to execute <code>git-rev-list</code> without starting <code>git bash</code>.</p>