How to apply directory dependent git configuration using conditional imports
- Published at
- Updated at
- Reading time
I just came across Marcus Crane's post Conditionally setting your gitconfig. Marcus explains how to use conditional includes and apply directory dependent git configuration.
Here's an example from his blog post:
[user] email = firstname.lastname@example.org name = User signingkey = ABC123 [commit] gpgSign = true [includeIf "gitdir:~/work/"] path = ~/.work.gitconfig
I don't need different git configurations these days, but it's good to know this feature exists. 👏