如何更改提交编辑器中显示的内容?
How to change what is shown in commit editor?
当我键入 git commit file.c
时,vim
会以类似
的内容打开
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Explicit paths specified without -i or -o; assuming --only paths...
# On branch work <- From here ->
# Changes to be committed:
# modified: file.c
#
# Untracked files:
# job.sh <- To here ->
我可以看出我引用的部分类似于 git status
的输出。怎么改?我想让它显示 git diff file.c
。可以吗?如果是,如何?
谢谢
运行git commit -v
。选项 -v|--verbose
正是这样做的。
如果您总是希望查看差异配置您的存储库(或全局):
git config [--global] commit.verbose true
当我键入 git commit file.c
时,vim
会以类似
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Explicit paths specified without -i or -o; assuming --only paths...
# On branch work <- From here ->
# Changes to be committed:
# modified: file.c
#
# Untracked files:
# job.sh <- To here ->
我可以看出我引用的部分类似于 git status
的输出。怎么改?我想让它显示 git diff file.c
。可以吗?如果是,如何?
谢谢
运行git commit -v
。选项 -v|--verbose
正是这样做的。
如果您总是希望查看差异配置您的存储库(或全局):
git config [--global] commit.verbose true