查看git所有配置
$ git config -l
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=E:/LearningSoftware/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager
设置用户名与邮箱 十分重要
git config --global user.name "tenton" #名称
git config --global user.email ******@qq.com #邮箱
查看不同级别的配置文件
查看系统config
$ git config --system --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=E:/LearningSoftware/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager
查看当前用户(global)配置
$ git config --global --list
user.name=tenton
user.email=*******@qq.com
Git相关的配置文件:
- E:/LearningSoftware/Git\etc\gitconfig :Git 安装目录下的 gitconfig --system 系统级
- C:\Users\Tenton\ .gitconfig 只适用于当前登录用户的配置 --global 全局