This function automatically grabs the latest git tag and, based on keyword (major, minor, patch), adds a new tag. (e.g. git_tag patch for v1.2.0 would create v1.2.1)
Drop this into your ~/.bash_profile and run source ~/.bash_profile to use it.
You can find all of my dotfiles here: https://github.com/drewbarontini/dotfiles
Differs from original in that: don't leak as globals,
vtag prefix is optional, and it prints usage text if you don't give it one of the SemVer keywords.