Python 的 Git 开发包:GitPython

jopen 10年前

GitPython 是一个 Python 库用来和 Git 资料库进行交互,提供各种级别的操作,例如高级的 git-porcelain 和低级的 git-plumbing.

GitPython 提供了 Git 对象的抽象封装以简化数据的访问。

示例代码:

from git import *  repo = Repo("/Users/mtrier/Development/git-python")  assert repo.bare == False    repo = Repo.init("/var/git/git-python.git", bare=True)  assert repo.bare == True

项目主页:http://www.open-open.com/lib/view/home/1396179445012