git 配置 rebase.abbreviateCommands

git config rebase.abbreviateCommands

我想启用 rebase.abbreviateCommands。我将下面的行添加到我的 git 文件 (~/.gitconfig),保存,打开一个新终端,cd 到 git 存储库,然后尝试 git rebase -i HEAD~ ,我仍然 "pick" 而不是 "p"。我通过删除配置和观察变化确认 git 正在使用这个文件,并通过 运行 git config -l.

[rebase]
        abbreviateCommands = true

文档: https://git-scm.com/docs/git-config (搜索缩写命令)

rebase.abbreviateCommands 是 Git 版本 2.16.0 中的新内容。你 运行 是什么 Git 版本?

如果您确实使用 rebase.abbreviateCommands,请考虑最新的 With Git 2.27(2020 年第 2 季度):
在 2.27 之前设置 rebase.abbreviateCommands 配置时,合并后端的“git rebase”无法正常工作。

参见 commit de9f1d3, commit 68e7090 (30 Mar 2020) by Alban Gruin (agrn)
(由 Junio C Hamano -- gitster -- in commit f72e067 合并,2020 年 4 月 22 日)

sequencer: don't abbreviate a command if it doesn't have a short form

Signed-off-by: Alban Gruin

When the sequencer is requested to abbreviate commands, it will replace those that do not have a short form (eg. noop) by a comment mark.
noop serves no purpose, except when fast-forwarding (ie. by running git rebase).

Removing it will break this command when rebase.abbreviateCommands is set to true.

Teach todo_list_to_strbuf() to check if a command has an actual short form, and to ignore it if not.