Today I'd like to share a technique that we use on every site at Jackson River.
For most projects, we have multiple developers working on different aspects of the site, and each of us has our own local development setup and checkout of the git repository. The problem we ran into, as any Drupal shop will, is the site configuration details included in
settings.php, and the way that those need to differ on our various development, staging, and production sites.
On some early sites, we used a switch statement in
settings.php that would check the requested URL, and set variables like
$db_url depending on that. When a new developer joined the project, they would add a new condition to the settings for whatever URL they were using (we each had our own local naming scheme, whether it was jacksonriver.com, jacksonriver.local, jr.dev, jrdev.local, and so on).
This was a terrible solution, and we stopped using it a long time ago. Instead, on every site we build, the settings file ends with an include: