Get all git commits since last tag

git log <yourlasttag>..HEAD

If you want them like in your example, on the one line with commit id + message, then

git log <yourlasttag>..HEAD --oneline

and in case you don’t know your latest tag or want this to be dynamic, on windows you could do

for /f "delims=" %a in ('git describe --tags --abbrev^=0') do @set latesttag=%a
git log %latesttag%..HEAD --oneline

and on linux / git bash / windows bash

git log $(git describe --tags --abbrev=0)..HEAD --oneline

Also, if you have a case where you know a tag in history and want to print everything from that tag up to current situation, you might want to add also --decorate so it would print out any tags in between.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)