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 f开发者_JS百科iles 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?
There was already the same question on Stack Overflow, with a solution: Reuse GIT_WORK_TREE in post-receive hook to rm a few files
精彩评论