Skip to content

Instantly share code, notes, and snippets.

View rafaltrzop's full-sized avatar

Rafał Trzop rafaltrzop

View GitHub Profile
@rafaltrzop
rafaltrzop / prepare-commit-msg
Last active October 17, 2018 12:51
Git prepare-commit-msg hook adding JIRA issue key before git commit message based on your branch name e.g. feature/KEY-1234
#!/bin/sh
###############################################################################
# Setup #
###############################################################################
# Use global hooks directory for each existing and new repository:
# $ git config --global core.hooksPath '~/.git-hooks'
# $ mkdir ~/.git-hooks
# $ chmod a+x ~/.git-hooks/prepare-commit-msg