tags:

views:

26

answers:

1

Hi,
So I have my local MAMP setup and running a test environment for my projects. When I upload it to the live server for staging I want to keep the passwords and usernames in for example config.php separate from those that are used on the server. This way I won't need to change those each time I push a commit to the server.

I have been using git add -i which is working out but still would like some feedback on how the workflow of others is looking like.

+2  A: 

You should use a gitignore file to ignore config.php. Then you can keep a separate file locally and on the server that git will ignore.

Just make a file in the root of your repo called .gitignore and put any file you want to ignore on its own line in the file.

seth
Thanks...but I think I should have made it more clear. I do use .gitignore for some files. But the config file has other options that I set as well...like a global array object where I add and delete certain settings controlling the entire site.
WmasterJ
The most obvious answer seems to be to break up the configuration options across more than one file. Maybe having a user_config.php file, for example. Of course I understand that this may not be practical for your particular situation, but as for my opinion, that's what I would do.
seth
That not a bad idea thx!
WmasterJ