在Python Dulwich中将标签/推送标签添加到远程 [英] add tag / push tags to remote in Python Dulwich
问题描述
我喜欢 Dulwich 项目,因为它提供了与git交互的纯Python接口.
I like the Dulwich project as it provides pure Python interface to interacting with git.
虽然看起来很底层……但是我找不到如何执行简单任务的参考.
我的需求非常简单,提供与下面的git CLI命令相同的内容:
It looks pretty low-level though... While I couldn't find reference on how to perform simple tasks.
My need's are pretty simple, provide the same as below git CLI commands:
-
git push --tags --force
-
git tag --force
-
git show-ref --tags
(提供标签和它指向的提交之间的映射)
git push --tags --force
git tag --force
git show-ref --tags
(provides mapping between tag and the commit it points on)
Update:
looks like item #3 is answered here:
How to get a list of tags and create new tags with python and dulwich in git? (by Jelmer the creator of Dulwich)
推荐答案
The dulwich.porcelain (https://www.dulwich.io/docs/api/dulwich.porcelain.html#module-dulwich.porcelain) module is somewhat more high level, and should do what you need.
特别是push和tag_create函数.请注意,当前没有强制参数,因为当前所有标签编辑都在没有安全检查的情况下完成.
Specifically, the push and tag_create functions. Note that there is currently no force argument since all tag editing is currently done without safety checking.
这篇关于在Python Dulwich中将标签/推送标签添加到远程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!