【问题标题】:git cherry-pick -x defaultgit cherry-pick -x 默认
【发布时间】:2012-06-24 21:07:19
【问题描述】:

man page forgit cherry-pick

...

-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 禁用它?我找不到,但我可能错过了。

【问题讨论】:

    标签: git config cherry-pick


    【解决方案1】:

    没有为git cherry-pick -x创建别名,不,这是不可能的。

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

    【讨论】:

      【解决方案2】:

      通过运行将此别名添加到您的 ~/.gitconfig:

      git config --global --replace-all alias.pick "cherry-pick -x"
      

      然后您可以简单地运行:

      git pick abc123
      

      您可以将“pick”选项替换为您认为有意义的任何词。

      【讨论】:

        猜你喜欢
        • 2013-11-18
        • 2011-10-27
        • 1970-01-01
        • 1970-01-01
        • 2016-02-11
        • 2012-09-06
        • 2018-07-27
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多