Skip to content

Instantly share code, notes, and snippets.

@Doyu-Lee
Doyu-Lee / prepare-commit-msg.sh
Created December 22, 2023 13:44 — forked from jonnyparris/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)