Skip to content

Instantly share code, notes, and snippets.

@halilim
Created November 29, 2013 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halilim/7704768 to your computer and use it in GitHub Desktop.
Save halilim/7704768 to your computer and use it in GitHub Desktop.
A very simple git deploy method. `git init` anywhere (e.g. /home/user/src) and add this to `.git/hooks/post-receive`. Now when you do `git push production master` (assuming the remote for server is "production"), your project will be deployed. Replace `/home/user/public_html` with the working directory (e.g. the web/project root). Files tracked …
GIT_WORK_TREE=/home/user/public_html git checkout -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment