#!/bin/bash BRANCH="$(git rev-parse --abbrev-ref HEAD)" if [[ "$BRANCH" != "master" ]]; then echo "Not on master branch, aborting" exit 1 fi today=`date "+%Y-%m-%d"` hotfix_tag=v$today.hotfix git tag -am "Hotfix release to production on $today" $hotfix_tag echo "please push the tag with" echo "git push origin $hotfix_tag"