Last active
May 4, 2018 14:15
-
-
Save daviddmr/23804d334c401600ad5436dfa5b10cbe to your computer and use it in GitHub Desktop.
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 | |
| # | |
| # Automatically adds branch name and branch description to every commit message. | |
| # Include this script into file in directory (PROJECT)/.git/hooks/prepare-commit-msg | |
| # Adapted by https://gist.github.com/shytikov/3132078 | |
| # | |
| NAME=$(git branch | grep '*' | sed 's/* //') | |
| TEXT=$(cat "$1" | sed '/^#.*/d') | |
| echo "[$NAME]"' - '$(cat "$1" | sed '/^#.*/d') > "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment