gpt4 book ai didi

git - 我可以在 git config 中设置推送选项(git push -o "...")吗?

转载 作者:行者123 更新时间:2023-12-04 02:02:27 25 4
gpt4 key购买 nike

Git 2.10 引入了 git push options (git push -o "my string")。

许多命令行选项都是可配置的,我想知道这是否也可行。我无法在 git-config 中找到它,但也许我忽略了它。

那么,是否可以添加(一组)默认推送选项,使其具有...

git push -o "r=joh.doe"

...运行时默认...

git push

?

上下文:我将其与 Gerrit 一起使用以直接将更改分配给审阅者( documentation for reference - 使用兼容语法 <push-ref>%my_string )。当上传许多更改并结对工作以审查彼此的代码时,如果我可以在推送时间将该人添加为审阅者,将会很有用。

最佳答案

这在 Git 2.16 中已变得可配置(引用 release notes)。

The "--push-option=" option to "git push" now defaults to a list of strings configured via push.pushOption variable.

因此,当在我的用例中应用于 Gerrit 时,这应该可以将审阅者添加到 john.doe 并默认在推送时间发布评论草稿。

git config --add push.pushOption r=john.doe
git config --add push.pushOption publish-comments

关于git - 我可以在 git config 中设置推送选项(git push -o "...")吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46217528/

25 4 0
文章推荐: jsf - 根据 的值有条件地渲染
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com