I would like to use Git to maintain my site while keeping it online, using only one server (i.e., make development changes and hosting it online using the same server, but in different folders).

Editing: as people are saying that my question is not clear I'll reformulate it this way, more simple: I would like to have a live site at /public_html/ and a development branch of the same site at /public_html/devel/ (for example) but would like that the site use git because it is more easy to after implement the /public_html/devel/ in /public_html/ (live, public), ie., just merging the branches 'development' to 'master'. A branch for /public_html/devel/ and a branch (master) in /public_html/.

But I am using a framework, and the 'protected/' folder is not inside /home/user/public_html/ (the same pub as before) but /home/user/nanana/protected/ (example --- outside 'public_html'), so I need git to have different sections for both.

So that when I access the 'public_html/devel/' (in browser, domain/devel), I have the landing page of the development version, acessing the 'protected' folder of the development version, and when I acess the root (public_html/in browser, domain/ root), I access the public landing page, of the public protected/ folder. (For "public protected/ folder" I mean the one that is not being developed)

I would like ideas for this. Don't know if this is possible but I think git should be able. Thanks!!

edit as people put this topic on hold: I need to mantain a site that have a live version, as well as a development version at the same time. The development version will be accessible only for the developer of course. The public will be public. The development will be at domain.com/devel/. The public will be at domain.com, root. I would like to use git to merge the development to public when it is ready to be published. Beside this, the protected folder is not inside the public folder.

  • This question is good, but belongs on Stack Overflow or possibly Server Fault because the solution I would recommend is using Apache name-based virtual hosts for the main site as well as a development site. But it’s unclear from your question how your server is setup or if that is a possibility. – JakeGould May 6 '14 at 22:22
  • Thank you for your reply @JakeGould, I tried to make my question more clear. Maybe I will post this at StackOverflow or ServerFault. – Iacchus May 7 '14 at 3:41
  • @Kassius The edits I made were to clarify and reopen the question, however, these added edits make this very difficult to follow now. – dan May 7 '14 at 3:52
  • @dan Which edits? I'm not sure, as various people are editing. – Iacchus May 7 '14 at 4:36
  • @Kassius The edits you made after mine - the others are mostly formatting fixes. – dan May 7 '14 at 4:42

Browse other questions tagged or ask your own question.