Multiple usernames and email address

suggest change

Since Git 2.13, multiple usernames and email addresses could be configured by using a folder filter.

Example for Windows:

.gitconfig

Edit: git config --global -e

Add:

[includeIf "gitdir:D:/work"]
  path = .gitconfig-work.config    

[includeIf "gitdir:D:/opensource/"]
  path = .gitconfig-opensource.config

Notes

.gitconfig-work.config

File in the same directory as .gitconfig

[user]
  name = Money
  email = work@somewhere.com

.gitconfig-opensource.config

File in the same directory as .gitconfig

[user]
  name = Nice
  email = cool@opensource.stuff

Example for Linux

[includeIf "gitdir:~/work/"]
  path = .gitconfig-work
[includeIf "gitdir:~/opensource/"]
  path = .gitconfig-opensource

The file content and notes under section Windows.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents