I'm begin in python and trying to use GitPython and I desperately tries to make working this module.
I've seen on many website that documentation is poor and the example I follow doesn't seems to work.
I've try this on Windows (2012/ Python 3.5):
# -*-coding:Latin-1 -*
from git import *
path = ('C:\\Users\\me\\Documents\\Repos\\integration')
repo = Repo(path)
assert repo.bare == False
repo.commits()
os.system("pause")
And this on Linux (Debian/Python 2.7) :
from git import Repo
repo = Repo('/home/git/repos/target_repos')
assert repo.bare == False
repo.commits ()
But anyway, I've no result... And finish with this error :
Traceback (most recent call last):
File "gitrepo.py", line 6, in <module>
repo.commits ()
AttributeError: 'Repo' object has no attribute 'commits'
in the two case.
My question is the following :
- Is there a way to make this module work ? All the link I found are old...
- If yes, please help me or giving me an example.
- If not, is there another module ? I've trying to install Dulwich but no succes (on Windows only)
- I've seen there is a way by using fab ? Is it possible to manipulate git with that ?
The goal is to manage git with python in the future, as well as other things for integration.
Thank you for your answer.
repo.headget you?repo.head()in my file.py, I get thatTypeError: 'HEAD' object is not callableif that's your question ?repo.head. Not a function.