繁体   English   中英

如何将 --force-with-lease 与(GitPython)git.remote.Remote 一起使用?

[英]How to use --force-with-lease with (GitPython) git.remote.Remote?

我正在努力成为 Pythonic。 因此,我有这个代码:

import git
import uuid

repo = git.Repo(...)
u = repo.create_remote(uuid.uuid4(), 'https://github.com/...')

如果我不想成为 pythonic,我可以这样做:

repo.git.push(u.name, refspec, '--force-with-lease')

...但想成为 Pythonic。 如何使用此( git.remote.Remote )object 进行--force-with-lease推送?

u.push(refspec, help=needed)

看来我可以说:

u.push(refspec, force=True)

...但我不认为这使用租约?

在快速浏览了 GitPython 的源代码之后,我猜想它在解释**kwargs kwargs 时会变成_ - 我认为正确的方法应该是:

u.push(refspec, force_with_lease=True)

基于: function dashify() ,从function transform_kwarg()调用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM