Last active
May 3, 2016 16:50
-
-
Save barnabyalter/78ecbc3e06e7fbea3f060fc7362c1e84 to your computer and use it in GitHub Desktop.
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 | |
FAILOVER_DIRECTORY="/apps/failover_errors" | |
FAILOVER_REPOS="git@github.com:NYULibraries/library.nyu.edu.git" | |
FAILOVER_BRANCH="gh-pages" | |
mkdir -p $FAILOVER_DIRECTORY | |
if [ -d "$FAILOVER_DIRECTORY" ]; then | |
cd $FAILOVER_DIRECTORY | |
git init | |
git remote add -f origin $FAILOVER_REPOS | |
git fetch --all | |
git config core.sparseCheckout true | |
if [ -f ".git/info/sparse-checkout" ]; then | |
rm .git/info/sparse-checkout | |
fi | |
echo "errors/" >> .git/info/sparse-checkout | |
git checkout $FAILOVER_BRANCH | |
git merge --ff-only origin/$FAILOVER_BRANCH | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment