Skip to content

Instantly share code, notes, and snippets.

@MattHealy
Created August 13, 2019 11:47
Show Gist options
  • Save MattHealy/694e1bb633243bf149193cd1395624f9 to your computer and use it in GitHub Desktop.
Save MattHealy/694e1bb633243bf149193cd1395624f9 to your computer and use it in GitHub Desktop.
Git pre-push hook to automatically deploy on master branch push
#!/bin/bash
BRANCH=`git rev-parse --abbrev-ref HEAD`
if [[ "$BRANCH" == "master" ]]; then
./deploy.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment