【发布时间】:2018-01-11 19:20:13
【问题描述】:
我有一些代码得到很多提交并且也经常被标记。
我想看看每个标签的提交是什么,然后我会在标签之间做一个 git diff 来查看实际的代码更改。
如何列出 git 提交及其标签在输出中交错?
我在想这样的输出可以让我看到每个标签的提交:
${short_commit_hash} ${commit_date} ${first_line_of_text_from_commit_message}
${short_commit_hash} ${commit_date} ${first_line_of_text_from_commit_message}
${short_commit_hash} ${commit_date} ${first_line_of_text_from_commit_message}
${tag_name} ${tag_date}
${short_commit_hash} ${commit_date} ${first_line_of_text_from_commit_message}
${short_commit_hash} ${commit_date} ${first_line_of_text_from_commit_message}
${short_commit_hash} ${commit_date} ${first_line_of_text_from_commit_message}
${tag_name} ${tag_date}
然而,这个输出并不是一个严格的要求。这只是我想出的一个想法,它可以帮助我查看每个标签的提交内容。
可能有一些简单的 git 命令已经完成了我所要求的大部分工作,并且这些命令可能非常简单/直接。
【问题讨论】:
-
git log --format=format:'%h %ci %s%n%D'让您完成 90% 的路程。