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:
from git import *
repo = Repo("path\to\my\repo")
lastCommit = repo.head.commit.committed_date
uncommitted = repo.is_dirty()
Everything works as expected until I run the last line which is when I get the error:
Traceback (most recent call last):
.
.
.
raise GitCommandNotFound: [Error 2] The system cannot find the file specified
I've tried this with other commands too and I get the same error. For example, repo.index.diff(repo.head.commit). I've also tried running repo.index.diff(None) and repo.index.diff('HEAD') which give the same error. What I really want is to essentially run $ git status for the repository I've named repo. I'm using Python 2.7.9 and gitpython 1.0.1 on Windows 7. Any help would be appreciated!