Skip to content

Instantly share code, notes, and snippets.

@lindhe
Created August 4, 2024 14:23
Show Gist options
  • Save lindhe/cd08c293af2e0cd0b14621b7f68e32ca to your computer and use it in GitHub Desktop.
Save lindhe/cd08c293af2e0cd0b14621b7f68e32ca to your computer and use it in GitHub Desktop.
A gitconfig to dynamically include different configs for different repos.
[user]
email = primary-work-email@example.com
[includeIf "gitdir:~/git/foo/"]
path = foo.gitconfig
[includeIf "hasconfig:remote.*.url:https://foo.example.com/**"]
path = foo.gitconfig
[includeIf "hasconfig:remote.*.url:git@foo.example.com:*/*"]
path = foo.gitconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment