Last active
August 29, 2015 14:06
-
-
Save shearluck/858eba5a17a2b0f47796 to your computer and use it in GitHub Desktop.
Git post-receive script - checkout based on currently pushed local branch
This file contains 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 ref | |
do | |
branch=`echo $ref` | |
echo "Pushing to branch $branch" | |
done | |
git --work-tree=/path/to/deploy/files --git-dir=/path/of/baregit.git checkout $branch -f | |
echo "All done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment