Last active
December 17, 2015 22:09
-
-
Save mgirouard/5679967 to your computer and use it in GitHub Desktop.
An informative post-receive hook. Useful if you do git deployments.
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 | |
# Receive <oldrev> <newrev> <refname> | |
read oldrev newrev refname | |
# The darget of the deployment | |
target=/var/www/vhosts/www.example.com | |
echo Deploying to $target | |
echo ======================================================= | |
git diff --name-only $oldrev..$newrev | |
echo ======================================================= | |
GIT_WORK_TREE=$target git checkout -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment