Created
February 6, 2014 05:52
-
-
Save gx86/8838971 to your computer and use it in GitHub Desktop.
post-receive hook to update site
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/bash | |
| while read oldrev newrev refname | |
| do | |
| branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
| if [ "master" == "$branch" ]; then | |
| GIT_WORK_TREE=PATH/TO/SITE checkout -f | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment