进行普通的git提交时,git commit --verbose
在写提交信息时会在文本编辑器中显示差异。
假设我正在进行交互式变基(git rebase --interactive
)以编辑先前的提交。要“继续”变基,我运行git rebase --continue
。这将打开一个文本编辑器以编辑提交消息,但它不会显示差异。在更改提交后,如何在交互式变基期间(重新)编写提交消息时显示差异?
git rebase --continue --verbose
似乎不是有效的命令...
进行普通的git提交时,git commit --verbose
在写提交信息时会在文本编辑器中显示差异。
假设我正在进行交互式变基(git rebase --interactive
)以编辑先前的提交。要“继续”变基,我运行git rebase --continue
。这将打开一个文本编辑器以编辑提交消息,但它不会显示差异。在更改提交后,如何在交互式变基期间(重新)编写提交消息时显示差异?
git rebase --continue --verbose
似乎不是有效的命令...
展示差异:
git -c commit.verbose=true rebase --continue
要使所有提交具有详细说明而无需每次指定-c commit.verbose=true
,请将以下内容添加到~/.gitconfig
:
[commit]
verbose = true
[commit]
verbose = true
参考文献:man git-config
。
git config --global commit.verbose true
。 - Burkart您可以做:
git -c commit.verbose=true rebase --continue
~/.gitconfig
中创建一个别名:[alias]
myrebasecontinue = "!git -c commit.verbose=true rebase --continue"
现在只需要执行以下操作:
git myrebasecontinue
git
源代码可以发现commit.verbose
是在git 2.9
中引入的。 - Arkadiusz Drabczyk在 rebase 过程中,
git diff
显示尚未添加到提交的更改内容,
git diff --cached
显示您提交的新更改,以及
git show
显示您正在编辑的提交中的原始更改。
:r !git diff
,不知道Git本身是否有自动执行此操作的功能。恐怕没有。 - kostixgit rebase --continue
。 - choroba
git rebase --continue
什么时候会打开文本编辑器? - Arkadiusz Drabczykgit add
标记更改后,git rebase --continue
会打开一个文本编辑器。@Arkadiusz Drabczyk - Flux