Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a website built on php and MySQL and trying to finally become more organised using git for making a distinction between code that is live and code that is still in test. I am the only developer working on the site

I cannot afford having a production and test server. So on the same server I made separate folders, one which is live /www/live/ and the other that is in development /www/dev/.

The development part of the site /www/dev/ is linked to a sub-domain dev.mydomain.com

Problem 1: I wish to setup git in such a way that my commits go to /www/dev/ and my pushes go live to /www/live. Is it reasonable to do it this way?

Problem 2: There are two places in the /www/dev code where links to the MySQL development database and folders are hard-coded. Commits would work fine, but then pushes would change the live code to now point to development databases and folders.

share

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.