git 修改配置

git config 查看配置信息

config 配置有system(系统级别)、global(用户级别) 和local(当前仓库)三个设置项

从system-》global-》local  底层配置会覆盖顶层配置 分别使用--system/global/local 可以定位到配置文件

查看系统config: git config --system --list

查看当前用户(global)配置:git config --global  --list

查看当前仓库配置信息:git config --local  --list

 

GIT 查看/修改用户名和邮箱地址

用户名和邮箱地址的作用:
用户名和邮箱地址是本地git客户端的一个变量,不随git库而改变。每次commit都会用用户名和邮箱纪录。github的contributions统计就是按邮箱来统计的。

查看用户名和邮箱地址:
$ git config user.name
$ git config user.email

修改用户名和邮箱地址:
$ git config --global user.name  username
$ git config --global user.email email
posted @ 2018-12-24 20:52  柔和的天空  阅读(3599)  评论(0)    收藏  举报