Last active
June 12, 2022 20:47
-
-
Save MedUnes/706380225fdb0ce79a13378d5b1af695 to your computer and use it in GitHub Desktop.
[Bash] Get the n(th) git tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
n=$1 | |
git for-each-ref --sort=-taggerdate | grep refs/tags/v | cut -d '/' -f 3 | head -$n | tail -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment