What is the preferred way to manage schema.rb in git?

前端 未结 8 933
醉酒成梦
醉酒成梦 2020-12-01 07:05

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

8条回答
  •  甜味超标
    2020-12-01 07:55

    One other thing you can do is use:

    git update-index --assume-unchanged /path/schema.rb
    

    This will keep the file in the repository but won't track changes. you can switch the tracking anytime by using:

    git update-index --no-assume-unchanged /path/schema.rb
    

提交回复
热议问题