Reputation: 22395
The structure I'm trying to setup is as follows:
/public_html
repository ("live") what the users see, contains custom
uploaded files (e.g. user gallery images, etc, these are ignored with .gitignore)
/stable
repository containing the latest stable source for the project (minus the ignored files)
/public_html/dev
development environment, where only myself and another developer will edit files in, test online directly from this folder.
Whenever any changes are made, they are done so in the /dev
repository, and changes are pushed up to /stable
which I would like to create a hook to automatically update the /public_html
repository with the latest stable files.
As I understand git development is usually cloned and done in a local environment, but due to licensing restrictions on the software we use, and it requiring a very specific server setup, doing local development is not an option. We therefore need to have a central development area to test changes.
My questions are as follows:
push
to a non-base repository can be troublesome.)Upvotes: 0
Views: 834
Reputation: 526593
/stable
should be a bare repository.
/public_html
should not be a repository at all - instead, you should use git archive
or similar in your hook to export files from the /stable
repository into /public_html
.
Ideally, I'd suggest not putting your dev
repository in /public_html
- it'd be better off in a separate document root of its own, that way you don't run into potential issues from path collisions etc.
Upvotes: 1