Skip to content

Instantly share code, notes, and snippets.

@samny
Created January 13, 2015 21:50
Show Gist options
  • Save samny/185641792997d5e2bd00 to your computer and use it in GitHub Desktop.
Save samny/185641792997d5e2bd00 to your computer and use it in GitHub Desktop.
Git deploy after push
#!/bin/bash
GIT_DIR=$(dirname $(dirname $(readlink -f $0)))
DEPLOY_DIR=/srv/www/$(basename $GIT_DIR)/public_html
git "--work-tree=${DEPLOY_DIR}" "--git-dir=${GIT_DIR}" checkout -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment