I have set up git on our webserver in a similar fashion as: http://toroid.org/ams/git-website-howto
The following post-receive hook is set up:
#!/bin/sh
GIT_WORK_TREE=/var/www/ git checkout -f
This works fine. However, there are certain directories and files that I do not want to copy to the webroot, but I do want them in the repository (so .gitignore is not an option). What is a good way to ignore them when checking out? Or should I copy them and then promptly remove them?