I’ve recently switched to a rather rad workflow involving a local copy of our website run through MAMP using a git repository.
We’ve recently started working on a bigger set of changes that require a feature branch. But, these changes also will require WordPress to be upgraded to 3.3, requiring database changes. Making it impossible to use the same database.
I was able to come up with this nifty technique for determining which DB to use.
That’s all there is to it. It works flawlessly.