Git changelog:如何获取所有更改到特定的标记? [英] Git changelog: how to get all changes up to a specific tag?

查看:267
本文介绍了Git changelog:如何获取所有更改到特定的标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法或命令来获取所有git提交到特定标记以生成项目的自动更新日志?我总是用像 v0.1.0 这样的版本号来标记我的git repos,例如将所有提交到标记 v0.1.0

我浏览过文档,但似乎找不到有用的选项或命令: http://git-scm.com/docs/git-log (目前正在下降)



例如:

  $ git log --oneline --decorate 

显示提交旁边的标签。我想要一样的,但只限于特定的标签。

解决方案

您可以这样做:

  git log --oneline --decorate v0.1.0 

...显示每个提交至v0.1.0(包括v0.1.0)的内容。当然, git log 也允许你限制任何以 git rev-list 理解,所以如果你只想看到 v0.0.9 v0.1.0 之间的变化,你也可以这样做:

  git log --oneline --decorate v0.0.9..v0.1.0 

另一个可能对此有用的输出是 git shortlog ,其中组和总结了每位作者的贡献。尝试,例如:

  git shortlog v0.1.0 


Is there an easy way or command to get all git commits up to a specific tag to generate an automatic changelog for a project? I always tag my git repos with a version number like v0.1.0 and for instance would like all commits up to tag v0.1.0.

I've looked through the docs but don't seem to find a useful option or command for it: http://git-scm.com/docs/git-log (is down at the moment by the way)

For instance:

$ git log --oneline --decorate

Shows the tags next to commits. I'd like the same, but only up to specific tag.

解决方案

You can just do:

git log --oneline --decorate v0.1.0

... to show every commit up to and including v0.1.0. Of course, git log allows also allows you to restrict the commits shown in any of the ways that git rev-list understands, so if you only wanted to see the changes between v0.0.9 and v0.1.0 you could also do:

git log --oneline --decorate v0.0.9..v0.1.0

Alternative output that might be useful for this purpose is that of git shortlog, which groups and summarizes the contributions of each author. Try, for example:

git shortlog v0.1.0

这篇关于Git changelog:如何获取所有更改到特定的标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆