获取git标签之间的提交列表


216

如果我有一个git存储库,其中包含表示发行版本的标签。

如何获取两个标签之间的提交列表(如果可能,使用漂亮的格式)?

Answers:


250

git log --pretty=oneline tagA...tagB (即三个点)

如果您只是想从tagB而不是tagA到达提交:

git log --pretty=oneline tagA..tagB (即两个点)

要么

git log --pretty=oneline ^tagA tagB



24

在当前分支的最新提交和标签之间进行比较:

git log --pretty=oneline HEAD...tag

16

为了风格输出到您喜欢的漂亮的格式,请参见手册页git-log

例:

git log --pretty=format:"%h; author: %cn; date: %ci; subject:%s" tagA...tagB

3

仅供参考:

git log tagA...tagB

提供一定范围内的标准日志输出。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.