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
.gitignore
supersecretstoragecredentials.ini
and create a supersecretstoragecredentials.ini-example
,
- instruct the user to copy
supersecretstoragecredentials.ini-example
to supersecretstoragecredentials.ini
.
- Add an overriding config file location in
backup.py
which 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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…