Skip to content

Instantly share code, notes, and snippets.

View brianmock's full-sized avatar

Brian Mock brianmock

  • Brattleboro, VT
View GitHub Profile
@brianmock
brianmock / prepare-commit-msg
Last active February 16, 2022 18:37
prepare-commit-msg git hook
#!/bin/bash
# Add this snippet to repo/.git/hooks/prepare-commit-msg
#
# Credit: https://medium.com/bytelimes/automate-issue-numbers-in-git-commit-messages-2790ae6fe071
#
# Inspects branch name and checks if it contains a Jira ticket number (i.e. ABC-123).
# If yes, commit message will be automatically prepended with [ABC-123].
#
# Useful for looking through git history and relating a commit or group of commits
# back to a user story.
[
{
"ordered":false,
"items":[
[
{
"content":"test one \n ",
"type":"text"
},
{