Skip to content

Instantly share code, notes, and snippets.

@haarts
Created August 5, 2014 08:29
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 haarts/85fc3a843b2274f807cc to your computer and use it in GitHub Desktop.
Save haarts/85fc3a843b2274f807cc to your computer and use it in GitHub Desktop.
Prepend pivotal feature number to commit message
#!/bin/sh
BRANCH_NAME=$(git symbolic-ref --short HEAD | sed "s/^feature_\([0-9]*\).*/\1/")
if [ -n "$BRANCH_NAME" ]; then
sed -i.bak -e "1s/^/[#$BRANCH_NAME] /" $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment