Created
November 7, 2016 11:48
-
-
Save whostolemyhat/26996f95e6fa455d70ef30b8ce57215d to your computer and use it in GitHub Desktop.
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 | |
# Check out the branch just pushed | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ -n "$branch" ]; then | |
GIT_WORK_TREE=~/myproject git checkout $branch -f | |
echo "/==========================================/" | |
echo "| Checked out branch: $branch |" | |
echo "/==========================================/" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment