Skip to content

Instantly share code, notes, and snippets.

@serranos
serranos / prepare-commit-msg.sh
Last active September 6, 2018 10:40 — forked from bartoszmajsak/prepare-commit-msg.sh
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##*/}"

Keybase proof

I hereby claim:

  • I am serranos on github.
  • I am serranos (https://keybase.io/serranos) on keybase.
  • I have a public key whose fingerprint is ECCC 11D8 09F5 D16B 0E75 ECE2 CEBA 9115 4105 AB83

To claim this, I am signing this object: