git multiple user names for the different projects within the same system [duplicate] git multiple user names for the different projects within the same system [duplicate] git git

git multiple user names for the different projects within the same system [duplicate]


Just use --local instead of --global. In fact, local is the default so you can just do

git config user.email personal@example.orggit config user.name "whatf hobbyist"

in one repo, and

git config user.email work@example.comgit config user.name "whatf at work"

in another repo

The values will then be stored in in the .git/config for that repo rather than your global configuration file.


Omit the --global from your call to git config:

git config user.name "A. U. Thor"

This will set the property in the current repository.