Skip to content

Instantly share code, notes, and snippets.

@tdowling
Created October 30, 2014 22:22
Show Gist options
  • Save tdowling/38a1c5c600ca78e7f55e to your computer and use it in GitHub Desktop.
Save tdowling/38a1c5c600ca78e7f55e to your computer and use it in GitHub Desktop.
Commit message to add branch name and newlines to pre-commit hook on osx
#!/bin/bash
BRANCH_NAME=$(git branch | grep '^*' | sed 's/^* //')
sed -i "" "1s/^/$BRANCH_NAME \\"$'\n'"\\"$'\n'"https:\/\/jira.company.com\/browse\/$BRANCH_NAME/" $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment