Created
September 9, 2019 07:38
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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