Last active
October 26, 2021 00:38
-
-
Save DonBattery/e2353b8c1e102225a23e4c02820ec49a to your computer and use it in GitHub Desktop.
gitmm
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
[alias] | |
# git jm "commit message" | |
# will add the Jira ticket ID (e.g.: PROJ-123) to your commit message | |
jm = "!f() { [[ $(git branch --show-current) =~ [A-Z]{2,}-[0-9]+ ]]; git commit -m \"${BASH_REMATCH[0]} ${1}\"; }; f" |
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
function gitmm() { | |
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
git commit -m "${BRANCH} ${1}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment