mip*_*adi 293
它不是"管道",但它会完全符合您的要求:
$ git log --format=%B -n 1 <commit>
Run Code Online (Sandbox Code Playgroud)
如果你绝对需要一个"管道"命令(不确定为什么这是一个要求),你可以使用rev-list:
$ git rev-list --format=%B --max-count=1 <commit>
Run Code Online (Sandbox Code Playgroud)
虽然rev-list除了提交消息之外还会打印出提交sha(在第一行).
Cha*_*esB 121
git show更像是一个管道命令git log,并且具有相同的格式选项:
git show -s --format=%B SHA1
Run Code Online (Sandbox Code Playgroud)
Har*_*eta 15
这将为您提供任何指定时间内所有消息的紧凑列表.
git log --since=1/11/2011 --until=28/11/2011 --no-merges --format=%B > CHANGELOG.TXT
Run Code Online (Sandbox Code Playgroud)
bst*_*rre 14
不管道,但我在.gitconfig中有这些:
lsum = log -n 1 --pretty=format:'%s'
lmsg = log -n 1 --pretty=format:'%s%n%n%b'
Run Code Online (Sandbox Code Playgroud)
那是"最后的总结"和"最后的消息".您可以提交提交以获取该提交的摘要或消息.(我使用的是1.7.0.5所以没有%B.)
nos*_*nos 14
我开始使用
git show-branch --no-name <hash>
Run Code Online (Sandbox Code Playgroud)
好像比
git show -s --format=%s <hash>
Run Code Online (Sandbox Code Playgroud)
两者都给出相同的结果
我实际上写了一个小工具来查看我所有 repos 的状态。你可以在github上找到它。
Cer*_*vEd 11
git-rev-list是让您打印提交消息的管道命令。
像这样使用它。
git rev-list --max-count=1 --no-commit-header --format=%B <commit>
Run Code Online (Sandbox Code Playgroud)
--max-count=1:我们只对一项提交感兴趣--no-commit-header: 不显示默认的提交头--format=%B:显示消息(主题%s+ %n%n+ 正文%b)<commit>: sha、HEAD、、等branch-nametag-namebranch1...branch2git log它比或快很多git show。