如何让 git 在交互式 git rebase 上生成短命令

Swi*_*iko 2 git

如何在它生成的交互式 rebase 上配置 git

p 3abc67f AAA
p 2b9c0ac BBB
Run Code Online (Sandbox Code Playgroud)

代替

pick 3abc67f AAA
pick 2b9c0ac BBB
Run Code Online (Sandbox Code Playgroud)

Ikk*_*kke 6

有一个名为 的配置选项rebase.abbreviateCommands,它可以满足您的需求。这个配置选项是在v2.16.0中引入的。在shell中,命令是:

git config rebase.abbreviateCommands true

man git-config说:

如果设置为 true,git rebase 将在待办事项列表中使用缩写的命令名称,结果如下:

p deadbee The oneline of the commit
p fa1afe1 The oneline of the next commit
Run Code Online (Sandbox Code Playgroud)