Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jonnyparris
jonnyparris / prepare-commit-msg.sh
Last active April 10, 2024 20:16 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with the Jira ticket reference from a branch name
#!/bin/bash
# For instance with feature/add_new_feature_HEYT-653
# $ git commit -m"Fixed bug"
# will result with commit "[HEYT-653] Fixed bug"
# Customize which branches should be skipped when prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)