Created
December 2, 2014 09:39
-
-
Save dietrichm/d13c41cb82c15c9d1b23 to your computer and use it in GitHub Desktop.
Git commit with ticket name
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
function git-ticket { | |
if [ $# -ge 1 ]; then | |
local branch=$(git rev-parse --abbrev-ref HEAD) | |
local ticket=${branch##*/} | |
local msg="${ticket}: $1" | |
shift | |
git commit -m "$msg" "$@" | |
else | |
echo "Missing comment." | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On branch ticket/FOO-123:
$ git-ticket "Some thing"
Commits as "FOO-123: Some thing".
Optional parameters at the end, e.g.:
$ git-ticket "Some thing" -a --dry-run