我需要一个管道命令来打印一个给定提交的提交消息——不多也不少。
当前回答
不是管道,但我有这些在我的。gitconfig:
lsum = log -n 1 --pretty=format:'%s'
lmsg = log -n 1 --pretty=format:'%s%n%n%b'
这是“最后的总结”和“最后的信息”。您可以提供一个提交来获得该提交的摘要或消息。(我使用1.7.0.5,所以没有% b)
其他回答
在git中单独获得我的最后一个提交消息
git log——format=%B -n 1 $(git log -1——pretty=format:"%h") | cat -
Git show更像是一个管道命令,而不是Git日志,并且有相同的格式化选项:
git show -s --format=%B SHA1
不是管道,但我有这些在我的。gitconfig:
lsum = log -n 1 --pretty=format:'%s'
lmsg = log -n 1 --pretty=format:'%s%n%n%b'
这是“最后的总结”和“最后的信息”。您可以提供一个提交来获得该提交的摘要或消息。(我使用1.7.0.5,所以没有% b)
我开始使用
git show-branch --no-name <hash>
它似乎比
git show -s --format=%s <hash>
两者都给出了相同的结果
实际上,我写了一个小工具来查看所有回购的状态。你可以在github上找到它。
我用shortlog来表示:
$ git shortlog master..
Username (3):
Write something
Add something
Bump to 1.3.8
推荐文章
- 为什么我需要显式地推一个新分支?
- 如何撤消最后的git添加?
- Rubymine:如何让Git忽略Rubymine创建的.idea文件
- Gitignore二进制文件,没有扩展名
- Git隐藏错误:Git隐藏弹出并最终与合并冲突
- 了解Git和GitHub的基础知识
- 没有。Git目录的Git克隆
- Git与Mercurial仓库的互操作性
- 忽略git中修改(但未提交)的文件?
- “git restore”命令是什么?“git restore”和“git reset”之间有什么区别?
- Git合并与强制覆盖
- Git拉另一个分支
- 在Bash命令提示符上添加git分支
- 如何更改Git日志日期格式
- git pull -rebase和git pull -ff-only之间的区别