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
version
on the current directory exists, then it contains is read, formatted and returned. - If the
--fallback
option is given then take it, formated and return. - If an environment variable
VERSION
exists, then take it, formatted and returned. - If there is no git tag in the commit history, then return
0.1.0
orVERSION
or--fallback
value or use the value on the fileversion
. - If there is no git tag in the commit history, then use the
--fallback-commit
option 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.