私はPythonで始めてGitPythonを使おうとしていますが、必死にこのモジュールを動かそうとしています。
多くの Web サイトで、ドキュメンテーションが貧弱であり、私が従う例が機能していないように見えることを見てきました。
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")
そしてこれは Linux (Debian/Python 2.7) で:
from git import Repo
repo = Repo('/home/git/repos/target_repos')
assert repo.bare == False
repo.commits ()
とにかく、結果はありません...そして、このエラーで終了します:
Traceback (most recent call last):
File "gitrepo.py", line 6, in <module>
repo.commits ()
AttributeError: 'Repo' object has no attribute 'commits'
2つの場合。
私の質問は次のとおりです。
- このモジュールを機能させる方法はありますか? 私が見つけたすべてのリンクは古いです...
- はいの場合は、私を助けるか、例を挙げてください。
- そうでない場合、別のモジュールはありますか? Dulwich をインストールしようとしましたが、成功しません (Windows のみ)
- fabを使用する方法があることを見てきましたか? それでgitを操作することは可能ですか?
目標は、将来的に git を python で管理することと、その他の統合を行うことです。
ご回答ありがとうございます。