Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log between tags

Tags:

git

I'm trying to output the log between two tagged commits.

mbell@cheetah [12:07:22] [/var/www/html/brone] [dev] -> % git tag  6.x-0.1 6.x-1.0-beta1 6.x-1.0-beta2 6.x-1.0-beta3 6.x-1.0-beta4 6.x-1.0-beta5 6.x-1.0-beta6 6.x-1.0-beta7 6.x-1.0-beta8 6.x-1.0-beta9 

If I then do:

git log 6.x-1.0-beta8 6.x-1.0-beta9 > ~/gitlogbrone.txt

It outputs all the commits since the start of the repo which isn't what I want. I've read through the git log manual but it's not helping much.

like image 406
digital Avatar asked Nov 15 '11 12:11

digital


People also ask

What is git log -- Oneline?

Git Log OnelineThe oneline option is used to display the output as one commit per line. It also shows the output in brief like the first seven characters of the commit SHA and the commit message. It will be used as follows: $ git log --oneline.

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.

How do I find the difference between two commits in git?

To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..


2 Answers

You need an ellipsis to indicate a range. Try git log tag1..tag2.

like image 111
Noufal Ibrahim Avatar answered Sep 22 '22 08:09

Noufal Ibrahim


I use this to get the commits between the last 2 tags:

git log --pretty=format:%s `git tag --sort=-committerdate | head -1`...`git tag --sort=-committerdate | head -2 | awk '{split($0, tags, "\n")} END {print tags[1]}'` > change_log.txt 
like image 25
wilmol Avatar answered Sep 26 '22 08:09

wilmol