Skip to content

Instantly share code, notes, and snippets.

Alex Shevchenko shevaroller

  • Vancouver, Canada
Block or report user

Report or block shevaroller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shevaroller
shevaroller / prepare-commit-msg.sh
Created Feb 14, 2018
Automatically prepend git commit message with a branch name
View prepare-commit-msg.sh
#!/bin/sh
#
# Hook script to prepend the commit log message with a branch name
# Prepend the name of the branch only if:
# - branch name starts with one of the options in $BRANCH_STARTSWITH
# - branch name has not been manually prepended in the commit message
BRANCH_STARTSWITH=(dev- WIP XYZ-)
BRANCH_NAME=$(git symbolic-ref --short HEAD)
COMMIT_MESSAGE=$(cat $1)
You can’t perform that action at this time.