Created
December 9, 2016 21:02
-
-
Save ae6rt/41abd3f8fdab2f940a7d266b3f40198a to your computer and use it in GitHub Desktop.
Git prepare-commit hook to put branch name in commit message
This file contains 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 | |
readonly TEMP_FILE=$(mktemp /tmp/commit-message-XXXX) | |
trap "rm -f ${TEMP_FILE}" EXIT | |
echo $(git rev-parse --abbrev-ref HEAD) > ${TEMP_FILE} | |
cat $1 >> ${TEMP_FILE} | |
mv ${TEMP_FILE} $1 |
Author
ae6rt
commented
Dec 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment