Is it possible to configure user.name and user.email per wildcard domains in .gitconfig?

Git 2.13 adds support for conditional config includes. If you organize your checkouts into directories for each domain of work, then you can add custom settings based on where the checkouts are. In your global git config:

[includeIf "gitdir:code/work/"]
    path = /Users/self/code/work/.gitconfig

And then in ~/code/work/.gitconfig:

[user]
    email = self@work.com

And of course you can do that for as many domains of work as you like.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)