so searching way handle configurations file in git projet. read articles subject of them suggesting second, local-only file. , doesn't feel right me.
so messed around of git commands find way achieve things way.
a way found possible may :
files
the config example simple key : value list inside file.
the local state lastest pulled version of template :
1 : 1 2 : 2 3 : 3 the remote state version on repository :
1 : 1 : 2 3 : 3 4 : 4 on file have 1 new field : 4 , modified field a.
finally working state configuration file used application. copy of local file modified secret values running application. version should not pushed repository.
1 : secret1 2 : secret2 3 : secret3 flow
here workflow thought :
on pull/checkout :
- backup
workingfile separate file prevent being rewritten; - do merge on
local,remotelast configuration template; - somewhat merge
local,saved_working.
the last merge should provide user display new field add, long not overriding existing fields values.
an example of such operation may :
1st merge :
- 2 : 2 + : 2 + 4 : 4 2nd merge :
1 : secret1 - 2 : secret2 + : 2 3 : secret3 + 4 : 4 and now, before being able use application again, see lines changes.
what think ?
i think application should able read many configuration files, , default configuration file should stored in repository; example:
- read /path/to/the/app/default.conf
- read system-wide /etc/application.conf
- read user configuration (ie: ~/.config/application.conf), if in same directory application, use .gitignore
some projects (like ansible vault) store encrypted version of configuration file, solution too.
would work setup?
another suggestion separate branch cherry-pick code or configuration, depending preferences.
edit: precisions cherry picking.
this suggestion, it's toughs merging, except choose commits want "remote".
on machine, working in local branch:
git fetch- either
git merge masterorgit cherry-pickcommits want
nothing ground-breaking, i'm not sure if expect operation automated or manual.
Comments
Post a Comment