Created
November 29, 2015 21:42
-
-
Save Teino1978-Corp/e99eb22bbdd1e8828736 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/sh | |
# only deploy when on the master | |
# add this file to .git/hooks in your repo | |
# add your preferred cloud storage account | |
dest="Dropbox" | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
if [ "master" == "$branch" ]; then | |
echo "Deploying to $dest" | |
unset GIT_INDEX_FILE | |
# change this to your cloud storage location | |
export GIT_WORK_TREE=C:/Operations/Dropbox | |
# change this to your repo | |
export GIT_DIR=C:/Users/janjoris/Documents/Git/Operations/.git/ | |
git checkout -f | |
else | |
echo "Not on master, deploy to $dest cancelled" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment