Skip to content

Instantly share code, notes, and snippets.

@andredublin
Forked from mgirouard/git-deploy
Created December 22, 2015 02:20
Show Gist options
  • Save andredublin/d73b422a3cfce55f9b80 to your computer and use it in GitHub Desktop.
Save andredublin/d73b422a3cfce55f9b80 to your computer and use it in GitHub Desktop.
A minimal git deployment script
#!/bin/bash
git push $1 +HEAD:master
git fetch $1
git push origin --tags
#!/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