Skip to content

Instantly share code, notes, and snippets.

@simonhayward
Last active August 29, 2015 14:04
Show Gist options
  • Save simonhayward/e9a9f6037599e23d1b55 to your computer and use it in GitHub Desktop.
Save simonhayward/e9a9f6037599e23d1b55 to your computer and use it in GitHub Desktop.
git-hooks-prepare-commit-msg
#!/bin/sh
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then
echo "[$BRANCH_NAME] $(cat $1)" > $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment