Created
August 22, 2016 06:37
-
-
Save sergeynikiforov/e272f5acf874b306d10c59e60408cf58 to your computer and use it in GitHub Desktop.
git hook to automatically prepend commit message with '<branch_name>: '
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 | |
# | |
# Automatically prepends commit message with a branch name. | |
# | |
NAME=$(git branch | grep '*' | sed 's/* //') | |
echo -n "$NAME"': '| cat - "$1" > /tmp/out && mv /tmp/out "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment