是否可以禁止提交消息编辑

Is it possible to suppress commit message editing

通常,我会在现有提交的基础上进行编辑,然后 运行

git commit -a --amend

然后它要求编辑现有的提交消息,我不需要更改。有没有不编辑消息就可以修改的方法?

您可以使用 --no-edit 只保留原始提交信息

git commit --amend --no-edit