Created
June 24, 2015 09:11
-
-
Save unarist/e8435023b28abf8fad5d to your computer and use it in GitHub Desktop.
pushdeploy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# cd .git/hooks/../.. | |
cd $(dirname "$0")/../.. | |
unset GIT_DIR | |
# read arguments | |
read oldrev newrev refname | |
branch=${refname#refs/heads/} | |
echo "Checkout branch and reset worktree..." | |
git checkout -f $branch && git reset --hard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment