Get a list of all tags between two commits

I have two commit hashes and you want to list all tags starting with phinx- between these two commit hashes. How can i do this?

Edit:

This is what I came up with. Is there a better solution

 git log --pretty=format:'%D' 35164f33..49085fbe | grep -o 'tag: phinx-[0-9]*' 
+6
source share
2 answers

If you can use comm command check this solution

 comm -23 <(git tag -l phinx-* --contains <sha1 start>) <(git tag -l phinx-* --contains <sha1 end>) 
+1
source

A quick hack can be:

 git log --oneline --decorate <sha1>..<sha1>|grep "tag:"| grep "phinx-" 

The actual solution may be more complex and include git rev-list .

+1
source

All Articles