目录

Git的必要配置

Git的必要配置

Git配置

(1)查看配置

git config -l

(2)查看系统配置

git config --system --list

其中,以Windows为例,系统配置保存Git安装目录下的在C:\Program Files\Git\etc\gitconfig下

https://i-blog.csdnimg.cn/direct/9d78c3ea738146ebbfa39f9c88e4c5fd.png

(3)查看当前用户配置

git config --global --list

其中,以Windows为例,用户配置保存在C:\Users\用户名.gitconfig下

https://i-blog.csdnimg.cn/direct/f5974a7ce80c4c4cab6a0d212f1bd703.png

当安装完Git后首先要做的事情是设置你的 用户名称邮箱地址 来用于之后的每次Git提交,都会使用该信息。将永远的嵌入到了你的提交中:

git config --global user.name "username"
git config --global user.email "number@qq.com"

其中–global参数表示机器上所有的Git仓库都会使用这个配置,当然也可以对某个仓库指定不同的用户名和email