Skip to content

Instantly share code, notes, and snippets.

@Stephs15
Created July 23, 2019 09:55
Show Gist options
  • Save Stephs15/34495ec5e2fead023105134505be9e22 to your computer and use it in GitHub Desktop.
Save Stephs15/34495ec5e2fead023105134505be9e22 to your computer and use it in GitHub Desktop.
#!/bin/sh
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | grep -oE "[A-Z]+-[0-9]+")
if [ -n "$BRANCH_NAME" ]; then
echo "$BRANCH_NAME $(cat $1)" > $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment