在我的远程存储库中我有文件, 例如,
-account.php
-Account.php
我现在使用 Windows git bash 从远程存储库克隆/pull 文件。
仅在这样做时
-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
<小时/>
文档
core.ignorecase
If true, this option enables various workarounds to enable git to work better on filesystems that are not case sensitive, like FAT.
For example, if a directory listing finds
makefile
when git expectsMakefile
, git will assume it is really the same file, and continue to remember it asMakefile
.The default is false, except git-clone(1) or git-init(1) will probe and set
core.ignorecase
true if appropriate when the repository is created.
关于php - Git::Windows:从远程存储库中提取区分大小写的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34970010/