Conditional Git config is not used
I have a conditional config for my git identities in my dotfiles:
[includeIf "gitdir:~/nb/"]
path = ~/.gitconfig_private
When I start nb it asks me for a name and email and adds them as global Git options:
[user]
name = Sven
email = [email protected]
Since I assume that the git repository nb operates is in ~/nb/ on macOS I expect that nb uses the identity option set by the includeIf in my Git config.
Thanks for the info. I’ll have to investigate this more. I’m still trying to get includeIf to work consistently in tests. The default directory for nb is ~/.nb (with a leading .).
The default directory for
nbis~/.nb(with a leading.)
Sorry, that's a typo. I did the test with right path and introduced the typo for the write up here. I double checked now: Also with the right path ~/.nb it does not work.
I have the same issue but with a slightly different config, where I have a ~/.gitconfig with the following:
[includeIf "hasconfig:remote.*.url:[email protected]:*/**"]
path = ~/.gitconfig-codeberg
This works fine for any of my other repositories that match the remote but nb seems to ignore this config. If I go to ~/.nb/home/ and then run git config -l | grep user, it shows the correct user settings.
It would be good to see this work, as I'm working with repositories across github/sourcehut/codeberg and nb forces me to have a global [user] config every time it syncs.