E
E
Evgeny Startsev2016-01-11 23:42:02
git
Evgeny Startsev, 2016-01-11 23:42:02

How to add a file to gitignore but keep it in the repository?

Hello
Is it possible to add a file to gitignore but keep it in the repository?
let's say there is a settings file (for connecting to the database) and it should be, but each has its own settings for connecting.
Thanks

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sunrails, 2016-01-11
@sunrails

Everyone can store their settings for connecting to the database in a specific file. Add this file to gitignore and it will remain only on the local machine - for each developer.
The whole point of gitignore is to not include the specified files in the repository.

1
1vanu4, 2016-01-12
@1vanu4

Off topic answer but good 12factor.net/config

A
Andrey Veklichev, 2016-01-12
@wzooff

In this case, it would be reasonable to use a file like db.config.example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question