Pregunta

I have a CodeIgniter php project in repo and have done a lot of updating to the database config file which contains all of my login information. I want other users or developers to be able to checkout my project and still get the config file, just without my login.

I'm sure this is a simple oversight somewhere, but I cannot find a reference to it at all.

¿Fue útil?

Solución

No, you can't do that: svn is a file based version control system. This means that it handles each file as a unique, atomic entity, that can have separate history, be committed or ignored, but only as a whole file.

If you want to hide your credentials you will have to extract the sensitive information from your config file (say config.php) to another file (say credentials.php). Then include credentials.php in your config.php and add credentials.php the svn ignore list without committing it. You will also have to communicate your colleges to put their credentials in their credentials.php, or even better you can commit a template credentials.php as described in Greg's link.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top