gpt4 book ai didi

python - 从 python 提交 Git

转载 作者:IT王子 更新时间:2023-10-29 00:57:08 25 4
gpt4 key购买 nike

我想用 python 编写一个模块(这是学习项目)来增强我的 git 体验。是否有用于各种 git 命令的 python 模块?至少是基本的(提交/差异/日志/添加)?

我看到了GitPython但我找不到对(新)提交的支持;它更像是一个 repo 浏览框架,而不是一个完整的 GIT 界面。 (或者我错过了什么?)

另外,如果有一个 python 模块用于所有这些,那会更好,还是从 python 代码执行 shell 命令?

最佳答案

在 GitPython 中你 create a commit from an index object

在 libgit2 中你是 create a commit from a repository object

您可能还想看看这个问题:

关于python - 从 python 提交 Git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7119452/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com