如何跳过“git commit --amend&rd;”中的提交消息步骤?

我正在运行一个非常快速的代码编译测试循环,我经常修改我的提交更改。 例如:
# Make some changes
$ git commit -m "Added feature X"
# Compile, test
# Fix bugs
$ git commit -a --amend
修复bug后,我通常需要相同的提交消息。有没有办法让git跳过我的
EDITOR
并只使用原始提交消息?     
已邀请:
您只需添加
--no-edit
即可使用上一条消息。此选项自2005年以来就存在,但仅在最近才启用了
--amend
选项。 另一种方法是使用修改选项将ѭ4添加到commit命令。这允许您不仅使用当前提交的消息,而且可以指定您喜欢的任何其他引用,因此值得记住它。 当从历史记录中的各个位置构造提交并使用其中一个提交的消息时,这尤其有用。例如:
git checkout feature1^^ -- database/table1.sql
git checkout feature1^^^^ -- logger.py
git add -A && git commit -C feature1
它只会使用来自feature1的2次提交,并使用上次提交的feature1中的提交消息 - 如果这是一个很好的描述。     
你也可以使用
--reuse-message=<commit>
Take an existing commit object, and reuse the log message and the authorship 
information (including the timestamp) when creating the commit.
这允许您使用以前的提交消息。这也可以是脚本或git别名的一部分。     
git commit --amend --reuse-message HEAD 
将重用上次提交的消息     
从git 1.7.9版本开始你也可以使用
git commit --amend --no-edit
    

要回复问题请先登录注册