从git show输出中提取提交消息体 上下文

从git show输出中提取提交消息体 上下文,git,Git,让我们假设我有以下提交: PS C:\temp\2021-05-06> git show eb60d3426333b6b6ba5cf34b8de36377b90c5868 commit eb60d3426333b6b6ba5cf34b8de36377b90c5868 (HEAD -> master) Author: dharmatech <dharmatech@xyz.com> Date: Thu May 6 10:34:03 2021 -0700 abc

让我们假设我有以下提交:

PS C:\temp\2021-05-06> git show eb60d3426333b6b6ba5cf34b8de36377b90c5868

commit eb60d3426333b6b6ba5cf34b8de36377b90c5868 (HEAD -> master)
Author: dharmatech <dharmatech@xyz.com>
Date:   Thu May 6 10:34:03 2021 -0700

    abc

    bcd
    cde
    def

diff --git a/bcd b/bcd
new file mode 100644
index 0000000..a034a61
Binary files /dev/null and b/bcd differ
它输出:

bcd
cde
def
问题: 是否有一种更直接的方法来执行上述操作,这可能是git工具内置的


如果没有,是否有更好的方法来解析正文行?

以下是我最终使用的方法:

PS C:\temp\2021-05-06> git show --no-patch 'eb60d3426333b6b6ba5cf34b8de36377b90c5868' --format='%b'

bcd
cde
def

删除差异部分的关键是
--无补丁

git日志
--格式
指令;大约有100个。其中有几家公司的目标是生产您想要的产品,包括与您想要的产品最接近的
%b
。谢谢@torek!根据您关于查看
%b
的建议,我能够找到一种方法来使用
git show
(相同的指令)完成它。我把对我有用的东西贴在下面。很简单。
PS C:\temp\2021-05-06> git show --no-patch 'eb60d3426333b6b6ba5cf34b8de36377b90c5868' --format='%b'

bcd
cde
def