2

I need a Python module which does not depend on the Git binary file. It should manipulate the index on its own, without making use of the git commands. Following are the basic requirements.

  1. Clone
  2. Commit
  3. Push to remote
  4. Handle authentication with username and password, and keys
  5. Pull and checkout files

As far as I know, GitPython and Gittle needs the git binary file. I'm looking for a python alternative for JGit which doesn't make use of the git binary.

4

1 回答 1

4

德威是一种选择。引用项目描述:

Dulwich 是 Git 文件格式和协议的 Python 实现,它不依赖于 Git 本身。

由于 Dulwich 实现了 Git 文件格式和协议,它是相当低级的。这些文档包括一个描述如何暂存和提交文件的教程。后面的教程章节描述了如何使用远程存储库

任何教程中都没有明确讨论身份验证,但假设您可以使用 HTTP Basic,您应该能够使用支持 HTTP 协议的 Dulwich。该库还声称支持 Git+SSH。

于 2014-11-05T09:32:58.883 回答