When you have a few developers working on the same site, you can easilyget into a very frustrating situation of they overwrite each other’s changes and the site keeps getting broken back and forth. This happens when, say, one developer puts in a fix, he releases the fix (some files) to the site, then later on, another developer who’s working on some other feature or fixes that release his files, and some of the files overlaps with the ones released by previous developers.
Now you can argue that you should use some sort of version control system(VCS) like svn, git, etc and implement some release process. But if you are talking about hetergenous developer profiles and experiences, not everyone uses VCS, and if you just have less than a handful of developers, you might not want to add too much overhead of implementing some kind of release process, which requires some training and authority of implementing it — and you might not have either.
So a much simpler approach would be just make sure before anyone puts code out there on the live site, make a diff between what’s on the live site code base and what you are going to push. If there is any diff that’s not from you (therefore from someone else), you need to merge that fix, or otherwise you unfix what the other developer fixes, or worse, breaks the site.
Now there is still one problem, you change might be big enough, and the other developer’s change might be just one line or two, so when you do a diff, you might very well miss the other developer’s change. So here’s an idea, I would set up a cron job on the webserver, and finds all the files that are modified in the last 24 hours (or whatever interval you like), and email the file list to the developers once a day. And the developer can also run this little command right before he pushes code, so that if he sees some files he’s going to push out is already in the last modified list (from the command), he will be extra careful, and make sure to resolve all the difference.
The command is rather simple:
cd /path/to/webroot; find . -mtime 1 -print | mail -s “files modified in last 24 hours” developer1@mysite.com developer2@mysite.com
Sometimes there are some cache files that keeps changing but irrelevant to the site codebase, you can just use “grep -v” to filter out those files, for example:
cd /path/to/webroot; find . -mtime 1 -print | grep -v ‘/caches/’ | mail -s “files modified in last 24 hours” developer1@mysite.com developer2@mysite.com
this will filter out any files/directories that has ‘/caches/’ in its path.






