Skip to content

Instantly share code, notes, and snippets.

@olbrichj
Created July 25, 2017 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olbrichj/773b0cdec47075a1886c10cb550c8248 to your computer and use it in GitHub Desktop.
Save olbrichj/773b0cdec47075a1886c10cb550c8248 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Automatically adds branch name to every commit message.
#
value=`cat $1`
type="$( cut -d ':' -f 1 <<< "$value" )"
contains=$(echo ${typeList[@]} | grep -o type | wc -w)
if [ contains -eq 0 ]; then
return 1
fi
NAME=$(git branch | grep '*' | sed 's/* //')
echo "$NAME"': '$(cat "$1") > "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment