作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在 Gitk 中,显示提交会产生如下输出:
Author: ...
Committer: ...
Parent: ...auth/parser)
Parent: ... (Merge branch '...')
Child: ...
Branches: remotes/me/foo, foo
有没有办法在 git log
中得到这种输出?使用 git log --graph
提供类似的信息,但在我的存储库中有长期存在的分支,可能需要大量滚动才能找到提交所在的分支。
最佳答案
我用这个:
git log --pretty=format:\"%h %ad [%an] %s%d\" --graph --date=short
--all --date-order
我将别名添加到我的全局 .gitconfig
[alias]
hist = log --pretty=format:\"%h %ad [%an] %s%d\" --graph --date=short --all --date-order
并且可以调用简单的git hist
它制作了非常易于阅读的修订树,在一行中包含简短的提交哈希、作者、日期、分支、HEAD 等
关于git - 如何在 `git log` 中的每个提交中显示分支名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10593229/
我是一名优秀的程序员,十分优秀!