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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5863426/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 10:50:53  来源:igfitidea点击:

Get commit list between tags in git

git

提问by telemaco

If I've a git repository with tags representing the versions of the releases.

如果我有一个带有代表版本版本的标签的 git 存储库。

How can I get the list of the commits between two tags (with a pretty format if is possible) ?

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

回答by manojlds

git log --pretty=oneline tagA...tagB(i.e. three dots)

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

If you just wanted commits reachable from tagB but not tagA:

如果您只想从 tagB 访问提交而不是 tagA:

git log --pretty=oneline tagA..tagB(i.e. two dots)

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

or

或者

git log --pretty=oneline ^tagA tagB

git log --pretty=oneline ^tagA tagB

回答by Ben Stiglitz

git logtakes a range of commits as an argument:

git log将一系列提交作为参数:

git log --pretty=[your_choice] tag1..tag2

See the man pagefor git rev-parsefor more info.

请参阅手册页git rev-parse更多信息。

回答by hidro

To compare between latest commit of current branch and a tag:

比较当前分支和标签的最新提交:

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

回答by lual

To style the output to your preferred pretty format, see the man pagefor git-log.

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

Example:

例子:

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

回答by starsinmypockets

FYI:

供参考:

git log tagA...tagB

provides standard log output in a range.

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