Skip to content

Instantly share code, notes, and snippets.

@palashkulsh
Created September 9, 2019 07:38
Show Gist options
  • Save palashkulsh/2a2c98887f23e3b2fa54a17021ae7c75 to your computer and use it in GitHub Desktop.
Save palashkulsh/2a2c98887f23e3b2fa54a17021ae7c75 to your computer and use it in GitHub Desktop.
.git/hooks/prepare-commit-msg putting branch name in every commit message to avoid manually typing . ch
#!/bin/sh
#chmod +x prepare-commit-msg
BRANCH=`git branch | grep '^\*' | cut -b3-`
FILE=`cat "$1"`
echo "$BRANCH $FILE" > "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment