how to add code version in git

C++
git tag -a "v1.5.0-beta" -m "version v1.5.0-beta"

Source

Also in C++: