Skip to content

Instantly share code, notes, and snippets.

@ChoiZ
Created January 21, 2016 14:20
Show Gist options
  • Save ChoiZ/deea7a23362de38f407d to your computer and use it in GitHub Desktop.
Save ChoiZ/deea7a23362de38f407d to your computer and use it in GitHub Desktop.
git hooks commit-msg with prepend branch-name
#!/bin/bash
#
# .git/hooks/commit-msg
#
# Last modified 2016-01-21
# François LASSERRE <francois@monechelle.fr>
current_branch=`git rev-parse --abbrev-ref HEAD`
sed -i bak -e "1s/^/${current_branch} /" $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment