【发布时间】:2020-01-28 18:18:36
【问题描述】:
我有一堆文件在新克隆后显示“要提交的更改”。自然,我的第一步是检查更改,假设它是行尾或文件模式更改,结果是实际代码行更改,例如:
$git status
[snip]
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
[snip]
modified: custom/Extension/application/Ext/Language/en_us.CSTM.php
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff custom/Extension/application/Ext/Language/en_us.CSTM.php
diff --git a/custom/Extension/application/Ext/Language/en_us.CSTM.php b/custom/Extension/application/Ext/Language/en_us.CSTM.php
index 47b9668e27..85bb53235b 100755
--- a/custom/Extension/application/Ext/Language/en_us.CSTM.php
+++ b/custom/Extension/application/Ext/Language/en_us.CSTM.php
@@ -1,316 +1,7 @@
<?php
-$app_list_strings['repeat_type_dom'] = array (
- '' => 'None',
- 'Daily' => 'Daily',
- 'Weekly' => 'Weekly',
- 'Monthly' => 'Monthly',
[snip]
这些行实际上已在文件中删除,当我验证文件本身时可以看到这些行。我没有这样做,因为这是一个新鲜的克隆。我还在 GitHub 上验证了 master 分支,哪个版本的文件是最新的,并且是删除了行的版本。这怎么可能?
添加一些额外的上下文:
几个月前,在重新签出这个 repo 时,我收到了这个错误:
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
'custom/Extension/application/Ext/Language/en_us.CSTM.php'
'custom/Extension/application/Ext/Language/en_us.cstm.php'
...然后是上面提到的更改列表。显然有人已经修复了重复文件,因为它们不再存在于 repo 中,但是当 repo 被新克隆时,文件更改仍然出现。
编辑:
为了论证:
$ git ls-files '*.php'
[snip]
en_us.CA_ASSEMENTS.php
en_us.CSTM.php
en_us.CallType.php
[snip]
【问题讨论】:
-
尝试
git ls-files '*.php'看看是否仍然存在区分大小写的重复项。 -
他们不在上面提到的
-
存储库是公开的吗?如果是这样,其他人可以验证您关于特定提交哈希 ID 的问题已解决的说法。请注意,no existing 提交可以随时更改,因此问题可能在较旧的提交中仍然存在 - 只有当这些提交本身也完全消失时它才会消失(这需要删除在所有后续提交中,这就是为什么这不太可能:必须进行完整的历史重写)。
-
我知道提交无法更改,因为我使用 git 已有十多年了。我从来没有遇到过这样的问题,不,我担心 repo 是私有的。我很高兴提供您希望我运行以验证的命令的输出。
标签: git