首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >git cherry-pick -x默认值

git cherry-pick -x默认值
EN

Stack Overflow用户
提问于 2012-06-22 22:36:34
回答 2查看 3.1K关注 0票数 20

man page for git cherry-pick

代码语言:javascript
复制
...

-x
    When recording the commit, append a line that says "(cherry picked
    from commit …)" to the original commit message in order to indicate
    which commit this change was cherry-picked from. ...

-r
    It used to be that the command defaulted to do -x described above,
    and -r was to disable it. Now the default is not to do -x so this
    option is a no-op.

...

是否有配置设置在本地将默认值重新设置为-x,并允许-r禁用它?我找不到,但我可能错过了。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-06-26 04:10:12

除非为git cherry-pick -x创建别名,否则这是不可能的。

(有趣的事实:在提交abd6970中更改了默认值。)

票数 14
EN

Stack Overflow用户

发布于 2021-12-09 17:33:32

通过运行以下命令将此别名添加到~/.gitconfig:

代码语言:javascript
复制
git config --global --replace-all alias.pick "cherry-pick -x"

然后,您可以简单地运行:

代码语言:javascript
复制
git pick abc123

您可以将"pick“选项替换为对您有意义的任何单词。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11158359

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档