3 ms·
Git has conditional includes based on path[1]. My configuration is like: On ~/.gitconfig [user] name = personal email = personal@example.com [inc
by augusto-moura 6y ago
Git has conditional includes based on path[1]. My configuration is like:
On ~/.gitconfig
[user]
name = personal
email = personal@example.com
[includeIF "gitdir:~/workspace/"]
path = ~/work.gitconfig
Then on ~/work.gitconfig
[user]
name = workname
email = work@example.com
[1] https://git-scm.com/docs/git-config#_conditional_includes https://git-scm.com/docs/git-config#_conditional_includes
- grenoire 6y agoWoah, this is neat!
- lilyball 6y agoJust a note of caution, when this feature was added tools based on libgit2 did not understand it. I just checked now, libgit2 eventually added support (though it took 5 months since I filed the ticket). But if you're using any tools that have a 3-year-old version of libgit2 they might not understand it.