Let's say I want to store URL and token for accessing API to configuration file. I have 3 environment, those are development, staging and production. They have different configuration value for each environment. I am using source control too. For sure, I don't want to share production environment configuration file to source control. So is there a best practice to manage this problem ?
Asked
Active
Viewed 129 times
1 Answers
0
Best thing you can do is Ignore that file in svn when committing. It will never be committed to repository.

Community
- 1
- 1

UIResponder
- 785
- 9
- 15
-
If i just ignored it, then I am afraid it will become more complicated in the future. Let's say I am working in a group, so if my friends add some configuration value, so I have to add that configuration manually before I published my apps. I am just wondering whether there is another way to accomplish this. How do you think about it ? Thanks for your suggestion – Hendra Huang Mar 10 '16 at 16:17
-
Okay. What we can do is, 1. Commit the configuration file with only your changes 2. Note down the revision number 3. You can normally update your code 4. This taking Update will modify your configuration file too. 5. Now, after Updating code from your team, you check out only the single file you want (which is your configuration file with only the changes you made.) 6. Please refer for checking out single file: http://stackoverflow.com/questions/1429034/checkout-a-specific-revision-from-subversion-from-the-command-line http://stackoverflow.com/questions/122107/checkout-one-file-from-subversion – UIResponder Mar 10 '16 at 16:26
-
@HendraHuang by the way, we can only checkout directories from SVN, so keep your config file in a directory(folder) and do steps mentioned above – UIResponder Mar 11 '16 at 10:31
-
I have not tried it yet. But i think it will work. I will inform you as soon as I give it a try. Thank you very much – Hendra Huang Mar 11 '16 at 15:43
-
Cool. But remember to put your config file inside a folder – UIResponder Mar 11 '16 at 15:55