Skip to content

Instantly share code, notes, and snippets.

@yaotti
Created November 21, 2010 06:23
Show Gist options
  • Save yaotti/708510 to your computer and use it in GitHub Desktop.
Save yaotti/708510 to your computer and use it in GitHub Desktop.
#!/bin/sh
# append the line "BRANCHNAME: " to the top of commit msg
if [ "$2$3" = "" ]; then
branch=$(git symbolic-ref HEAD 2>/dev/null)
branch=${branch##refs/heads/}
echo "$branch: \n`cat $1`" > "$1"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment