Automate your commit messages
Simply create/modify your project's .git/hooks/prepare-commit-msg - e.g. automatically prepend the [ticket number] from the beginning of your current branch's name:
#!/bin/sh
ORIG_MSG_FILE="$1"
TEMP=`mktemp /tmp/git-XXXXX`
TICKETNO=`git branch | grep '^\*' | sed 's/[_]/ /g' | cut -f 2 -d ' '`
(echo "[$TICKETNO] "; cat "$ORIG_MSG_FILE") > "$TEMP"
cat "$TEMP" > "$ORIG_MSG_FILE"
Written by Roman Blöth
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#