A great deal of my development is done using git for two main reasons:
1. A network connection isn’t required to interact with the repository, and
2. Branching is ridiculously easy.
Before git I was using – and branching – with Subversion. While doing it in svn isn’t hard .. it’s certainly not as easy. There are many tricks to remember where branch revisions started, which make it easier to deal with the after-branch merges that I’ve put together over the years, but really that’s not the point of this article.
So, branching. It’s a great way to play with your code without risking the quality of your code. Many times when doing Rails development, I end up with branches that have slightly unique database schemas between them. This introduces a problem when you’re actively switching between branches and your development database is constantly out-of-sync. The best way that I’ve found to combat this problem is by creating a dynamic database configuration.
Below is a sample of a database.yml which will facilitate unique schemas per branch:
So, you can see that when the database configuration is loaded, it will dynamically decide the currently active git branch and change the physical database used for any subsequent requests.
Do you often run into this problem, and if so.. what do you do to solve it?

Looks like you need to update your gist. If I go look at the actual gist on Github, I can see the latest version which is slightly different.
Thanks Braxton. I went ahead and just replaced the local copy with the Gist embed script. It looks as though the local copy got a bit messed up due to formatting issues. :-\