Getting release number from git in command line

$ git --git-dir=.git --work-tree=projectName describe --abbrev=0 --tags

Is there someway to get the exact release number 1.5.5 from git or do I need to depend on string manipulation to achieve that ?

1 Like

That command gives you the most recent tag reachable from the current commit. Git itself doesn’t ascribe any meaning to tag names, you’ll need to handle that yourself. So yes, string manipulation it is.