Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save edwinestrada/9926858 to your computer and use it in GitHub Desktop.
Save edwinestrada/9926858 to your computer and use it in GitHub Desktop.
#!/bin/sh
BRANCH_NAME=$(git symbolic-ref --short HEAD)
if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then
sed -i.bak -e "1s/^/[$BRANCH_NAME] /" $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment