2015-06-18

Useful git aliases when working with Maven and Jira

Put these into your .gitconfig below the alias section:

# Return all jira issue keys from commit messages
issues = !sh -c 'git log --oneline $@ | egrep -o [A-Z]+-[0-9]+ | sort -V | uniq' -
# Fetch id of latest commit from maven release plugin
release-commit = !sh -c 'git log --all --grep=maven-release-plugin.*prepare.release --format=%H| head -1'
# Return all jira issue keys since last usage of maven release plugin
issues-since-release = !sh -c 'git issues $(git release-commit)..'


1 comment:

  1. Added the `-V` to `sort` which will sort them in versionized order, i.e. XYZ-42 comes before XYZ-240, which is not the default!

    ReplyDelete

Followers