Created
December 1, 2019 14:52
-
-
Save seesleestak/21052d924d1ab6fb27546a906e960cf9 to your computer and use it in GitHub Desktop.
Prefix the commit message with the current branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # !/bin/bash | |
| CURR_BRANCH=$(git symbolic-ref HEAD --short) | |
| BLACKLIST=("master" "develop") | |
| if [[ -n $CURR_BRANCH ]]; then | |
| if [[ $(echo "${BLACKLIST[@]}" | grep --word-regexp "$CURR_BRANCH") ]]; then | |
| git commit -m $1 "${@:2}" | |
| else | |
| git commit -m "$CURR_BRANCH: $1" "${@:2}" | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment