So I have a git repository that hold three folders. This is fine for my local web server. However, up on the live server, two of these folders need to be behind the webroot and one of them needs be in the webroot. I’d like to use a git repo on the server for easy pushing/pulling, but the folders need to go in different places.
Does anyone have a solution for this?
Thanks!
You basically have two options. You can either set up the webserver so that the one directory you want is in the webroot (by symlinking and allowing to follow symlinks, or by setting the document root appropriately) or have some external process copy them.
For the latter, you could have a simple copy cron job, or a slightly more sophisticated git commit hook that does the copying. If you used something like
rsync, you would only copy things that have actually changed as well. You could of course take this approach further and have a full blown continuous integration system which, after running tests, copies the files into the correct place.