在 Windows bash 中,它似乎git config --list显示了多个范围的设置,但没有告诉您每个范围的设置。
我试图通过将core.autocrlf所有内容设置为 false 来确保我再也不会遇到 CRLF 问题。
git config --list 给我这样的东西:
$ git config --list
core.symlinks=false
core.autocrlf=input // <-- HERE
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
gui.recentrepo=C:/Users/Buttle/PhpstormProjects/stuffs
gui.recentrepo=C:/Users/Buttle/PhpstormProjects/lolcatz
user.name=buttletime
user.email=Buttle@example.com
core.autocrlf=false // <-- AND HERE
credential.helper=cache --timeout=3600
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
remote.origin.url=https://github.com/buttletime/lolcatz.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
gui.wmstate=normal
gui.geometry=1385x655+182+182 420 192
branch.master.remote=origin
branch.master.merge=refs/heads/master
Run Code Online (Sandbox Code Playgroud)
似乎第二个可能是我的lolcatz项目的本地项目。但是当我检查它时,我的全局设置也是“假”。
git config --list --show-origin给出配置设置的源文件。
从 FILES 部分man git-config:
如果未使用 --file 显式设置,则 git config 将在四个文件中搜索配置选项:
$(prefix)/etc/gitconfig:系统范围的配置文件。
$XDG_CONFIG_HOME/git/config:第二个用户特定的配置文件。如果$XDG_CONFIG_HOME未设置或为空,$HOME/.config/git/config将使用。此文件中设置的任何单值变量都将被~/.gitconfig. 如果您有时使用旧版本的 Git,最好不要创建此文件,因为最近才添加了对此文件的支持。
~/.gitconfig:用户特定的配置文件。也称为“全局”配置文件。
$GIT_DIR/config:存储库特定的配置文件。
编辑:看起来该--show-origin标志是在v2.8中引入的
| 归档时间: |
|
| 查看次数: |
3071 次 |
| 最近记录: |