Mary Louise Hermosa
1 min readDec 19, 2017

--

You can change your global .gitconfig to specify a unique user.email for all nested repositories. That way, you won’t have to respecify your local user variables over and over. (Only available for git versions2.13 and later.)

In your ~/.gitconfig file, add

[includeIf "gitdir:/path/to/work/dir/"]
path = /path/to/new/config

Add another .gitconfig-{namespace} file and inside should have your desired configurations.

[user]
name = Your Name
email = email@work.com

Reference: https://git-scm.com/docs/git-config#git-config-codegitdircode

Updated 12/20/2017 1:02pm : Included disclaimer that this guide is only applicable to later git versions. And edited the conditionals to reference a separate configuration file to mirror the documentation.

--

--