Skip to content

Instantly share code, notes, and snippets.

@cmrd-senya
cmrd-senya / prepare-commit-message
Last active October 6, 2023 06:54 — forked from jakeonrails/prepare-commit-message
prepare-commit-message that requires a JIRA ID and adds it if the branch name contains one
#!/usr/bin/env ruby
# Git Prepare Commit Message Hook Script
#
# Location: <repository>/.git/hooks/prepare-commit-msg
#
# This script will automatically add the correct
# JIRA ISSUE ID to the end of each commit message
# When the branch ID starts with the JIRA ISSUE ID.
# It can be overridden if specified in the message.