3 ms·
I was using that approach for a while, but the problem is if you're in the folder defined in the includeIf - and you clone new repository from there - it will u
by trzeci 5y ago
I was using that approach for a while, but the problem is if you're in the folder defined in the includeIf - and you clone new repository from there - it will use your root config, not the additional config.
includeIf path matching works only if the folder is already under git.
A solution is to make a dummy repo in the repo where includeIf points to - but that is annoying a little, as sometimes it confuses IDEs or makes shell (ZSH + addons) slower - as it tries to seek for changes.
The best solution I've found is to unconditionally include an additional config in the main config. But the additional config is coming from a dynamic location that I mount in my shell when I work. Basically during the working hour I mount my entire partition which is encrypted under ~/work. And I have my config under ~/work/.gitconfig. I have also there my additional shell config - so during working hours I have everything set up.
The cons is that I need to mount/unmount that partition every day.