有时我们可能会有多个git帐号连接到多个不同的server,或者相同的server.
Git共有三个级别的config文件,分别是system、global和local。在当前环境中,分别对应%GitPath%\mingw64\etc\gitconfig文件、$home\.gitconfig文件和%RepoPath%\.git\config文件。
其中%GitPath%为Git的安装路径,%RepoPath%为某仓库的本地路径。所以system配置整个系统只有一个,global配置每个账户只有一个,而local配置和git仓库的数目相同,并且只有在仓库目录才能看到该配置。
首先查看本地配置:
打开git bash,输入: git config --list
输出大概如下:
$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process