By Noxxxx from https://www.noxxxx.com/git-%e5%8d%95%e9%a1%b9%e7%9b%ae%e8%ae%be%e7%bd%ae%e7%94%a8%e6%88%b7%e5%90%8d%e9%82%ae%e7%ae%b1.html
欢迎分享与聚合,尊重版权,可以联系授权
如果是自己的电脑,通常我们只会设置一个全局的 Github 邮箱和用户名
但是工作电脑既有公司项目又有私人的项目,全局的设置为了公司的 Git 配置
这个时候不小心提交的话,就会把用户名和邮箱给提交上去。
git config --global user.name "userName"
git config --global user.email "email"
单个项目单独配置
git config user.name "私人的用户名"
git config user.email "私人的邮箱"
# 查看该仓库的配置
git config --list