Skip to content

Instantly share code, notes, and snippets.

View single-stop-rj's full-sized avatar
🏠
Working from home

Robert J Robinson single-stop-rj

🏠
Working from home
  • FedCap / Singlestop
  • North Brunswick, NJ
  • X @rjrobinson
View GitHub Profile
@bartoszmajsak
bartoszmajsak / prepare-commit-msg.sh
Last active July 30, 2025 19:22
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"