Similar to alastair, I have different configs for different release branches and have a script to quickly switch between them.
I used to use an automatic script that used a git hook to switch to a db of the same name as the branch but it got annoying having to install new dbs all the time.
Simon