Created
September 30, 2016 13:18
-
-
Save MikaelPikael/2ec1c712435135a4ae73573f57ac95a5 to your computer and use it in GitHub Desktop.
Parse task number from git branch name and add it in your 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 | |
# | |
task=$(git rev-parse --abbrev-ref HEAD | sed "s/_.*//") | |
echo "\n\n\n$task #review" > /tmp/commitmsg.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The pre-commit is located in your .git/hooks directory
You need to update your .git/config file with:
[commit]
template = /tmp/commitmsg.txt