Gary Green
Gary Green

Reputation: 22395

Setting up a git web development environment

The structure I'm trying to setup is as follows:

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.

Development area

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:

  1. How could I achieve the above structure?
  2. What needs to be a base repository and what does not (as I understand push to a non-base repository can be troublesome.)
  3. Any improvements/suggestions?

Upvotes: 0

Views: 834

Answers (1)

Amber
Amber

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

Related Questions