When looking at the tutorial located here for gitpython, and following step by step there are some issues on my machine. The environment is Windows 7, and git version 1.7.11.msysgit.1 along with Python 2.7. Everything installed fine with easy_install. Repo object successfully gets created, and commands like repo.tree()
and repo.branches
work. If I do a repo.is_dirty()
there are non-specific file not found errors. WindowsError: [Error 2] The system cannot find the file specified.
Any ideas?
path = "c:\\path_to_repo"
repo = Repo(path)
assert repo.bare == False
print repo.tree()
repo.branches
print dir(repo)
#these always crash...
repo.is_dirty()
TIA for any help.
You might not have git.ext
in your PATH
, but that can easily be tested by executing it yourself. If you see an error, you can either add it to the PATH
, or set the GIT_PYTHON_GIT_EXECUTABLE
to the executable that git-python should execute for git command line services.
The reason it works for .tree()
and related object queries is that gitpython uses a pure-python backend for these operations. More complex operations like .is_dirty()
still require the git executable to be in your PATH
by default.