为每个项目单独设置用户名和邮箱¶
问题描述¶
提交git
记录前需要先设置用户名和邮箱,最常用的方式就是全局设置
$ git config --global user.name xxx
$ git config --global user.email xxx
# 查看
$ git config -l
最近想要在服务器上进行版本管理,不方便全局设置,可以在项目路径下进行本地设置
方式一¶
进入项目路径,执行如下命令
$ git config --local user.name xxx
$ git config --local user.email xxx
# 查询
$ git config --local -l
方式二¶
直接在.git/config
配置文件中设置
[user]
name = xxx
email = xxx