现象
默认的情况下,Git对文件名大小写不敏感
即使改变文件名,使用 git status
命令,仍然无法发现所做的改变
配置
/etc/gitconfig 文件:系统中对所有用户都普遍适用的配置。若使用 git config 时用 --system 选项,读写的就是这个文件。
~/.gitconfig 文件:用户目录下的配置文件只适用于该用户。若使用 git config 时用 --global 选项,读写的就是这个文件。
当前项目的 Git 目录中的配置文件(也就是工作目录中的 .git/config 文件):这里的配置仅仅针对当前项目有效。每一个级别的配置都会覆盖上层的相同配置,所以 .git/config 里的配置会覆盖 /etc/gitconfig 中的同名变量。
运行命令 git config --system core.ignorecase false
配置 git
对文件名大小写敏感
查看配置
$ git config --list
credential.helper=osxkeychain
core.ignorecase=false
user.name=Josaber
user.email=<email>
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
网友评论