Skip to content




Getting the latest tag of a project

I wanted to get the latest tag

https://stackoverflow.com/a/7261049

# one way to do it using describe
git describe --tags --abbrev=0

# another way to use straightforward git tag, and see the recent 3
git tag -l --sort=-creatordate | head -n 3

# checkout the latest tag
git checkout $(git describe --tags --abbrev=0)

adding git tag

https://git-scm.com/book/en/v2/Git-Basics-Tagging

# confirm existing tags
git tag -l 

# set tag to the latest commit and push
git tag {tag_name}
git push --tags 

# show the last commit log of the tag 
git show {tag_name}