title: How to check if a Git Repo has uncommitted changes using Python
body: <p>I'm pretty new to git, but I'm trying to use python to check if a git repository has any uncommitted changes. I seem to get the same error no matter what command I try to run using python. Here's my code:</p>
  
  <pre><code>from git import *
  repo = Repo("path\to\my\repo")
  lastCommit = repo.head.commit.committed_date
  uncommitted = repo.is_dirty()
  </code></pre>
  
  <p>Everything works as expected until I run the last line which is when I get the error:</p>
  
  <pre><code>Traceback (most recent call last):
  .
  .
  .
      raise GitCommandNotFound: [Error 2] The system cannot find the file specified 
  </code></pre>
  
  <p>I've tried this with other commands too and I get the same error. For example, <code>repo.index.diff(repo.head.commit)</code>. I've also tried running <code>repo.index.diff(None)</code> and <code>repo.index.diff('HEAD')</code> which give the same error. What I really want is to essentially run <code>$ git status</code> for the repository I've named <code>repo</code>. I'm using Python 2.7.9 and gitpython 1.0.1 on Windows 7.  Any help would be appreciated!</p>