Skip to content

Instantly share code, notes, and snippets.

View Scuilion's full-sized avatar
👻

Kevin O'Neal Scuilion

👻
View GitHub Profile
@Scuilion
Scuilion / prepare-commit-msg.sh
Last active October 26, 2016 21:10 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/usr/bin/env bash
BRANCHES_TO_SKIP=(master develop test)
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
DASHES="${BRANCH_NAME//[^-]}"
if [ ${#DASHES} -gt 1 ]; then