Skip to content

Instantly share code, notes, and snippets.

@mwq
Created January 20, 2016 14:57
Show Gist options
  • Save mwq/e65f47e091827df53083 to your computer and use it in GitHub Desktop.
Save mwq/e65f47e091827df53083 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Stolen from http://stackoverflow.com/questions/3525341/can-i-use-a-scripted-commit-template-for-git
ORIG_MSG_FILE="$1"
TEMP=`mktemp /tmp/git-XXXXX`
TICKETNO=`git rev-parse --abbrev-ref HEAD | cut -d_ -f1`
(echo "[$TICKETNO]"; cat "$ORIG_MSG_FILE") > "$TEMP"
cat "$TEMP" > "$ORIG_MSG_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment