Simon Mo
Simon Mo

Reputation: 773

Is it possible to setup an accessible Git Staging Directory?

Currently I am running a VPS with CentOS 6.6 Apache 2.2 and Php 5.4.37.

My Question is regarding Git which I have installed.

I would like to know if it is possible to setup Git to work with my desired workflow as currently I have to merge files manually.

Scenario.

I have http://www.example.com and http://dev.example.com in two different directories /live/httpdocs and /dev/httpdocs. I work on dev.mysite.com all day long and use the address http://dev.example.com to test my code etc Then when I am Happy with the code, I want to be able commit to the http://www.example.com directory.

Does anyone know how this can be setup?

I have looked all over the internet but can't seem to come to a conclusion. Most answers are quite vague.

Thanks for the help in advance.

Simon

Upvotes: 1

Views: 31

Answers (1)

MrKekson
MrKekson

Reputation: 740

If i understand you correctly, then here is your answer:

http://nvie.com/posts/a-successful-git-branching-model/

Basically i would create 2 main branche, one for dev, and one for release ( you can do more, like testing etc ), i think it's better to protect the release branch, so you can't push in it by mistake, but you can merge the testing into it, with proper rights. You can also create hooks( you can find samples in your repo's .git/hooks directory ), so git can 'auto' deploy to your host, or just manually pull your main branche, anter you merged in the test.

Upvotes: 1

Related Questions