在我的远程存储库中,我有文件,
例,-account.php
-Account.php
要查看我的存储库的外观,
我现在正在使用Windows git bash从远程仓库中克隆/拉出文件。
虽然只这样做-account.php
被克隆,而-Account.php
被忽略!
我如何获得两个文件,-account.php
-Account.php
到我的本地存储库中,这样我就可以删除它们并仅使用一种命名约定对文件进行干净提交,并消除我做的错误?
最佳答案
由于git是基于unix的,因此它只是区分大小写的软件。
如果提交了区分大小写的文件,则需要重命名它们。使用git mv
命令将告诉git重命名文件,同时保留文件的所有历史记录
# "move" the file from the old name to the new name
git mv -f File file
# Add the file to the staging area
git add .
# commit your changes
git commit -m "renamed file..."
Git的配置设置为
core.ignorecase
。要告诉Git区分大小写,只需将此设置设置为
false
:git config core.ignorecase false
文献资料
从
git config
documentation:core.ignorecase
如果为true,则此选项启用各种变通办法,以使git在不区分大小写的文件系统(例如FAT)上更好地工作。
例如,如果目录列表在git期望
makefile
时找到Makefile
,则git将假定它确实是同一文件,并继续将其记为Makefile
。缺省值为false,但在创建存储库时,如果适用,git-clone(1)或git-init(1)将进行探测并将
core.ignorecase
设置为true。