如何在GIT中构建标签树?
How to build a tag tree in GIT?
作为 GIT 的常客,我爱 git log --graph
就像我爱 git tag
一样。我负责一个大型 GIT 存储库,其中有太多分支和标签,而我在 sisyphusian 减少这些数字的工作上进展得太慢了。
拥有一个标签树图会非常有帮助,就像通常的提交图一样,但是只有那些有标签的分支 就可以了。我还需要每个标记提交的哈希值(理想情况下还需要时间戳和作者)。
我搜索了很多,但从未找到与我描述的一样的东西。
一些参考(非常多)
- Git: How to find out on which branch a tag is?
- Unable to show a Git tree in terminal
作为最新版本中的 Amadan pointed out, I should have dived deeper into the git-log documentation。解决方案只是包含 --simplify-by-decoration
标志。总而言之,我得到了以下结果
git log --graph --simplify-by-decoration --pretty=format:'%C(yellow)%h %ad %an%Cgreen%d %Creset%s' --date=short
official formatting documentation解释了--pretty=format:'...'
的所有细节,最重要的部分是
%h
= 缩写提交哈希
%an
= 作者姓名
%ad
= 作者日期
%s
= 主题
如果想记住一些东西,就用
git log --graph --simplify-by-decoration
这为您提供了一个没有提交哈希和 git-tag 的输出。
作为 GIT 的常客,我爱 git log --graph
就像我爱 git tag
一样。我负责一个大型 GIT 存储库,其中有太多分支和标签,而我在 sisyphusian 减少这些数字的工作上进展得太慢了。
拥有一个标签树图会非常有帮助,就像通常的提交图一样,但是只有那些有标签的分支 就可以了。我还需要每个标记提交的哈希值(理想情况下还需要时间戳和作者)。
我搜索了很多,但从未找到与我描述的一样的东西。
一些参考(非常多)
- Git: How to find out on which branch a tag is?
- Unable to show a Git tree in terminal
作为最新版本中的 Amadan pointed out, I should have dived deeper into the git-log documentation。解决方案只是包含 --simplify-by-decoration
标志。总而言之,我得到了以下结果
git log --graph --simplify-by-decoration --pretty=format:'%C(yellow)%h %ad %an%Cgreen%d %Creset%s' --date=short
official formatting documentation解释了--pretty=format:'...'
的所有细节,最重要的部分是
%h
= 缩写提交哈希%an
= 作者姓名%ad
= 作者日期%s
= 主题
如果想记住一些东西,就用
git log --graph --simplify-by-decoration
这为您提供了一个没有提交哈希和 git-tag 的输出。