Last active
December 22, 2015 02:20
-
-
Save mgirouard/5853000 to your computer and use it in GitHub Desktop.
A minimal git deployment script
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 | |
git push $1 +HEAD:master | |
git fetch $1 | |
git push origin --tags |
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 | |
read oldref newref refname | |
target=/var/www/vhosts/www.example.com | |
echo Deploying to ${oldref:0:7}..${newref:0:7} to $target | |
GIT_WORK_TREE=$target git checkout -f | |
git diff --stat $oldref..$newref |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save as
~/bin/git-deploy
, then: