当git commit打开消息编辑器时,它会显示一个简短的状态,如下所示:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is ahead of 'origin/master' by 26 commits.
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: Showcase/src/com/gigantt/BorderArea.mxml
# modified: Showcase/src/com/gigantt/Client.mxml
# modified: Showcase/src/com/gigantt/GraphItem.mxml
#
我如何调整git以显示要提交的差异?我知道这可能会比较长,但仍然很有用。
您要做什么,需要提交消息中列出的更改?您可能对特定工具有误解,我们也许可以帮助您解决实际问题。
—
Mark Rushakoff 2011年
会为您提供一些您无法从“ git log -p”获得的信息吗?
—
杰德·施耐德
@Mark:OP希望对差异进行注释。它是默认已注释掉提示的更详细的版本。@Jed:OP希望在提交消息模板中提供此信息。是的,
—
卡斯卡贝尔2011年
git diff --cached会生成它,但是如果每次都需要运行单独的命令,为什么呢?
github.com/tpope/vim-fugitive/issues/149跟随这个逃犯,以防万一。如果不是,那应该是。
—
lkraav