I don\'t want to add schema.rb
to .gitignore
, because I want to be able to load a new database schema from that file. However, keeping it checked
Instead of using .gitignore
, use separate branches: Develop
which omits schema.rb
and Test
and Deploy
which include schema.rb
. Only make code changes in the Develop branches and never merge from Test
into Develop
. Keep schema.rb
in a separate branch:
Developer A
Develop --------
Local Schema \ Your Repo
Test ---------> Dev A
---------> Dev B
Developer B / Master
Develop -------- Schema
Local Schema Test
Test Deploy
In Git, branches are pointers to collections of file contents, so they can include or exclude particular files as well as track file versions. This makes them flexible tools for building your particular workflow.