Instea of uploading to a middle man like github then doing a pull on your production or staging server you can use this trick to push directly to the production or staging server over SSH
These instructions will show how to use a git hook( in this case post-receive ) to do whatever is needed on the server(receiving) side.
This allows for high security(no middle men) and high flexibility as you can use Bash scripts to do whatever is required.
- Know how to use GIT, Terminal etc.
- Have a local working-working copy ready