Hey SP,
I’m curious about using git to manage updates of a website.
First, let me explain my situation. I’ll be as “quick to the point” as possible.
I am the main coder of a website, I work with one web designer once in a while. Our website is currently divided up into 4 subdomains, each with their own mysql databases.
- www. is the live public access site
- dev. is where I write new code and features
- design. is where the designer writes new css or images
- live-test. is where we test out our updates
I have written a small collection of web based tools in PHP that allow me to compare the differences between the subdomains. This helps me see what files are new or updated in comparison to the other subdomains. These tools also allow me to quickly put new files, or new versions of files on the other domains, or completely mirror one subdomain to the other. These updates tools also allow me to quickly mirror one database from one subdomain to the other.
My tools no longer work because they make extensive use of the exec() function in PHP. The exec() function allows an executing PHP script to run a native linux program and then receive the output from the command. We have just switch server hosts, and our new host will not permit us to use exec() due to security concerns.
So that’s why we are now considering git to manage the update process. Can git provide me the same functionality as my web based tools and how would I even begin to set this up?.
Here is what I’m thinking I’d have to do to set this up. Please correct me if I’m wrong.
- Install git on my machine
- Install mysql and apache + php on my machine
- Download our website and database onto my computer.
- Turn the webroot and sqlroot into git repositories
- Install git on the webserver
- Get webserver to checkout the website and database from my machine.
- Get designer to install git on his Mac and get him to checkout the site
Now for updating the website, it would go something like this.
- The designer would commit his changes to my machine.
- I checkout the new latest version with his changes.
- I make my changes to the website, and commit them.
- Get webserver to check out new version of the website.
To me this all seems a bit cumbersome for just managing a website so I’m confident I must understand the process incorrectly. I’m also curious how git would manage different databases and how it could compare the differences. Also curious what happens if I and the designer each work on the same file and both have valid changes that need to be committed. I’m assuming we can only alter one file at a time.
I know this thread is getting long! So I’ll wrap it up here and say thank you kindly for reading through and hopefully responding.