解决git提交记录不是自己名称的问题
git config配置作者信息
问题:提交记录发现不是自己的
因为这是根据作者的名称邮箱来记录的,所以我们要在提交中配置好自己的名称信息
解决方法
- 配置全局的信息
$ git config --global user.name ‘your_name’
$ git config --global user.email ‘your_email@domain.com’
但有可能你有公司项目,是其他名称,所以这个方法不好 - 配置项目的git信息
$ git config --local user.name ‘your_name’
$ git config --local user.email ‘your_email@domain.com’
这样就只会对当前仓库有效,这样的好处就是你设置了作者信息,不会影响到其他项目的仓库。
常用参数
config有几个常用参数, 缺省等于local
- –local 只对当前仓库有效
- –global 对登录⽤户所有仓库有效
- –system 对系统的所有⽤户有效
- –unset 清除某个信息
git config --unset --local user.name
显示config的配置可以 加 --list
git config --list --local