Skip to content

Instantly share code, notes, and snippets.

@pawndev
Last active July 19, 2019 11:55
Show Gist options
  • Select an option

  • Save pawndev/aef16ebe17c8791716dddaee10c7148e to your computer and use it in GitHub Desktop.

Select an option

Save pawndev/aef16ebe17c8791716dddaee10c7148e to your computer and use it in GitHub Desktop.
pre-commit-msg
#!/bin/sh
BRANCH_NAME=$(git branch 2>/dev/null | grep -e ^* | tr -d ' *')
if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ] && [ "$BRANCH_NAME" != "(nobranch)" ]; then
echo "$BRANCH_NAME | $(cat $1)" > $1
fi
@pawndev

pawndev commented Dec 10, 2018

Copy link
Copy Markdown
Author
cd .git/hooks
wget https://gist.githubusercontent.com/pawndev/aef16ebe17c8791716dddaee10c7148e/raw/1ab109e84146b2382d456fe95c78df511ce9fcbf/prepare-commit-msg
chmod +x ./prepare-commit-msg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment