Last active
November 13, 2015 16:25
-
-
Save elvisciotti/627e0afd7ec1f570a668 to your computer and use it in GitHub Desktop.
bash function to commit a message prepending the 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
# gitcommit this message will be commited, with the branch name prepended | |
# e.g. (on branch feature01) | |
# > gitcommit this is the commit message | |
# > Committed with message "feature01 this is the commit message" | |
gitcommit() { | |
gm_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p'); | |
gm_commitMessage="${gm_branch} $@" | |
git commit -m "${gm_commitMessage}" | |
echo Committed with message \"$(git log -n1 --pretty=format:%s)\" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment