Answer the question
In order to leave comments, you need to log in
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
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.
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 questionAsk a Question
731 491 924 answers to any question