Skip to content

Instantly share code, notes, and snippets.

@albburtsev
Created October 10, 2013 12:15
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 albburtsev/6917386 to your computer and use it in GitHub Desktop.
Save albburtsev/6917386 to your computer and use it in GitHub Desktop.
❯ cat .git/hooks/prepare-commit-msg
#!/bin/bash
b=`git symbolic-ref HEAD| sed -e 's|^refs/heads/||' | sed -e 's|_.*||'`
c=`cat $1`
if [ -n "$b" ] && [[ "$c" != "[$b]:"* ]]
then
echo "[$b]: $c" > $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment