To get the commit of the latest tag, I'm doing
$(git rev-parse $(git describe --tags --abbrev=0))
But if there is no tag at all, it will throw the error fatal: No names found, cannot describe anything
.
So in case, there is no tag at all, I would like to get the first commit at all. How do I have to do it?
$(git rev-parse $(git describe --tags --abbrev=0 || <?-- get the very first commit -->))