Skip to content

Instantly share code, notes, and snippets.

@amine2233
Forked from developernotes/changelog.sh
Created June 16, 2022 09:15
Show Gist options
  • Save amine2233/3ba42517a3ecdf62a218264aa7d80e4a to your computer and use it in GitHub Desktop.
Save amine2233/3ba42517a3ecdf62a218264aa7d80e4a to your computer and use it in GitHub Desktop.
Display a simple changelog between the last two tags in a Git repository
#! /usr/bin/env sh
firstTag=$(git tag | sort -r | head -1)
secondTag=$(git tag | sort -r | head -2 | awk '{split($0, tags, "\n")} END {print tags[1]}')
echo "Changes between ${secondTag} and ${firstTag}\n"
git log --pretty=format:' * %s' ${secondTag}..${firstTag}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment