I have a repository with a rails app in the production Server.
In the repo there is the .gitignore file:
...
config/database.yaml
...
Every developing client have a cloned repo with different config/database.yaml.
My problem is this:
database.yaml is in .gitignore, then when I run git clone (on the server) the database.yaml will not be created, but I need it.
I thought than I am doing wrong something. Can you see where is my mistake ?
thank you, Alessandro
In my projects, I usually make a copy of a usable database config in a database.example.yml, then when someone clones the projects, copy the database.example.yml to database.yml and make the needed changes.
(here is a copy of my original answer to your first question)
You don't version the right file.
You should version:
database.yaml.templatedatabase.yaml on the checkoutThat script would be called by the smudge step of a filter driver.

The resulting database.yaml would be "private" (never versioned/pushed or pulled), and can be modified at will.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With