Problem
Consider this file tree as my development repository.
- foo/
- .git/
- [...]
- bar/
- backupclient.py
- supersecretstoragecredentials.ini
For development, supersecretstoragecredentials.ini needs to be filled in with valid credentials – while I still have to keep a clean version of it in the repository so that other users can easily set their credentials.
Possible solutions
.gitignoresupersecretstoragecredentials.iniand create asupersecretstoragecredentials.ini-example,- instruct the user to copy
supersecretstoragecredentials.ini-exampletosupersecretstoragecredentials.ini.
- instruct the user to copy
- Add an overriding config file location in
backup.pywhich is ignored by git, e.g.supersecretstoragecredentials_local.ini.
As kan pointed out, these two solutions are similar but not entirely the same, workflow-wise.
are there any other alternatives? Does git possess some kind of functionality to assist with this kind issues?
Check in the supersecretstoragecredentials.ini file with some placeholder values and then
Git will not track future changes to this file.
You can reset this using