This tool provides version auto-generation using git tags.
Use this following syntax:
VERSION = $(shell path/to/git-version-gen.sh)
You can check an example into the Makefile on this project.
- If a file named
versionon the current directory exists, then it contains is read, formatted and returned. - If the
--fallbackoption is given then take it, formated and return. - If an environment variable
VERSIONexists, then take it, formatted and returned. - If there is no git tag in the commit history, then return
0.1.0orVERSIONor--fallbackvalue or use the value on the fileversion. - If there is no git tag in the commit history, then use the
--fallback-commitoption to specify a base commit hash.
This project is based on the script GIT-VERSION-GEN of the git project.
Thanks to gitster and all of contributors to the project git.
