I’ve checked out a new branch to install a gem that I often have various troubles with. The problem is that even though I can destroy this branch, the results of running rake db:migrate are surviving in the database and in db/schema.rb. Since I’m having trouble undoing the database changes, I’m having to scrap the app and then start over. Big time waste.
Is there anything I can do with git this time before running rake db:migrate so that if I decide to nix this branch, then I won’t have those problems with the database, the migration files, and db/schema.rb?
If you build your migrations properly then you can roll them back before you kill off your new branch. If for some reason your migrations are irreversible, then back up your database before you start experimenting and restore it if your experiments don’t work out.
I don’t think there is anything git-specific you can do though.