- 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
4 separate environments seems a bit much for a 2 man team.
Two environments on the server should be enough - www(production) and live-test(staging), you and your designer should be working in your own local environment and making all changes there. I can't think of a legitimate reason for the other two environments on the server.
So you'll want 3 remotes that you can push/pull code from
origin - a central repository like Github
staging - staging server
prod - live server
At a minimum you want two separate branches in git:
develop - where you and the designer make changes
master - production ready code
- Turn the webroot and sqlroot into git repositories. I'm also curious how git would manage different databases and how it could compare the differences
Not all files on the server need to be in source control, only what you want to be able to change. I'm not sure what you have in sqlroot but assuming it's your data in your database this shouldn't be in source control - git isn't used to compare differences in databases. What should be in source control instead are sql scripts for updating your database, schema changes, new data - that type of thing.
The basic work flow goes something like:
You and the design both checkout from origin/develop to get the latest from the central source repo.
Make your changes
Commit your changes
Push to origin/develop
You and the designer can both work in the same branch are in sync, when you're confident enough with the code there you can merge to master and push to the staging server to test. If all goes well you push master to the production server and run any necessary database scripts.
If you try to push to origin/develop and your designer has also made changes to the same files you'll get a merge conflict and be able to see both sets of changes along-side each other. It's up to the person who pulls the code last to resolve these conflicts and commit the final versions. This all happens before the code is commited and pushed to a server.
I hope that gives you a bit more info, I think git will make things a heck of a lot easier for you than comparing differences in code and databases across your four servers