[英]git cherry-pick -x default
In the man page for git cherry-pick
:在
git 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.
...
Is there a config setting to locally set the default back to -x
, and allow -r
to disable it?是否有配置设置可以在本地将默认值设置回
-x
,并允许-r
禁用它? I couldn't find one, but I may have missed it.我找不到,但我可能错过了。
add this alias to your ~/.gitconfig by running:通过运行将此别名添加到您的 ~/.gitconfig 中:
git config --global --replace-all alias.pick "cherry-pick -x"
You can then simply run:然后你可以简单地运行:
git pick abc123
You may replace the choice of "pick" to whatever word makes sense to you.您可以将“pick”选项替换为对您有意义的任何词。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.