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

孤者浪人 提交于 2019-11-27 16:43:21

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

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

in one repo, and

git config user.email work@example.com
git 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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!