php - Git::Windows:从远程存储库中提取区分大小写的文件

标签 php git bash github

在我的远程存储库中我有文件, 例如,

-account.php

-Account.php

要查看我的存储库到底是什么样子,See

我现在使用 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
<小时/>

文档

来自git config documentation :

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 expects Makefile, git will assume it is really the same file, and continue to remember it as Makefile.

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/

相关文章:

php - 我可以将所需文件的全部内容存储在 JavaScript 变量中吗?

php json_decode 删除具有空值的属性

git - 是否可以同时拥有跟踪的 .gitignore 和未跟踪的 .gitignore?

Bash 包自动化/w 操作系统检测

linux - 从文件脚本错误添加用户帐户

javascript - 无法阻止点击登录后密码在密码字段中自动延长

php - 如何在 AWS EC2 上为 PHP 启用 openssl(仅用于后端调用 - 而不是传入流量)?

git - 使用 'git pull' 与 'git checkout -f' 进行网站部署

Visual Studio 中的 Git 多个存储库

string - 如何替换字符串中的字符,但前提是该字符出现在分隔子字符串中?