This gist assumes:
- you have a local git repo
- you have an online remote repository (github)
- you have a server running Apache with git already installed
you should be able to do the same with Java, Perl, RoR, JSP etc. however you'll need to recreate the (rather simple) PHP script