From: Torsten Bögershausen Date: Fri, 13 Mar 2015 09:36:06 GMT Subject: Re: Is it possible get the tag name of working copy in Git? Message-ID: <5502AF86.9050803@web.de> In-Reply-To: On 03/13/2015 08:08 AM, chen chang wrote: > I want to use make file auto generate the revision number of working > copy from the tag name in git. You should have the tag name, as it is set up before running make, and probably feed into both "git checkout tagXXYYXX" and the Makefile. If you want the "version number", what is this ? Git has a sha value, you can git it like this: git rev-parse HEAD | cut -b 1-9 HTH