This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
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 = user@example.com
name = User
signingkey = ABC123
[commit]
gpgSign = true
[includeIf "gitdir:~/work/"]
path = ~/.work.gitconfig
The git docs describe that you include configs depending on branch name, too.
I don't need different git configurations these days, but it's good to know this feature exists. ?
Reply to Stefan
This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

Stefan Judis | Sciencx (2021-08-29T18:00:00+00:00) How to apply directory dependent git configuration using conditional imports (#tilPost). Retrieved from https://www.scien.cx/2021/08/29/how-to-apply-directory-dependent-git-configuration-using-conditional-imports-tilpost/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.