flmon flmon - 6 months ago 66
Git Question

How to get previous tag name?

There are some tags:

first
second
third
fourth


I need to get the tag before "second" (third).

Answer

git describe --abbrev=0 second^