Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git changelog: how to get all changes up to a specific tag?

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.

like image 936
Luwe Avatar asked Sep 12 '11 12:09

Luwe


People also ask

How do you see what changed in a git commit?

To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.

How do I see git tags?

Find Latest Git Tag Available In order to find the latest Git tag available on your repository, you have to use the “git describe” command with the “–tags” option. This way, you will be presented with the tag that is associated with the latest commit of your current checked out branch.


1 Answers

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 
like image 174
Mark Longair Avatar answered Oct 12 '22 14:10

Mark Longair