Skip to content

Instantly share code, notes, and snippets.

View micahrcorn's full-sized avatar

Micah micahrcorn

  • New York, NY
View GitHub Profile
@micahrcorn
micahrcorn / gist:75bffbbf0405a9837664
Created February 9, 2016 17:02
sample prepare-commit-msg
#!/bin/sh
#
# Automatically adds branch name and branch description to every commit message.
#
NAME=$(git branch | grep '*' | sed 's/* //')
TEXT=$(cat "$1" | sed '/^#.*/d')
if [ -n "$TEXT" ]
then
echo "$NAME"' '$(cat "$1" | sed '/^#.*/d') > "$1"