Ответ 1
Update
Я понял, почему только пользователи Windows имеют проблемы:
$ git ls-files | grep -i class.bat
etc/apps/phpsysinfo/plugins/BAT/class.BAT.inc.php
etc/apps/phpsysinfo/plugins/bat/class.bat.inc.php
В индексном файле Git существуют версии для верхнего и нижнего регистров. Пользователи Linux должны извлекать оба файла и даже не заметить, потому что Linux чувствителен к регистру и рассматривает их как два отдельных файла, как они есть.
Windows не чувствительна к регистру в отношении путей к файлам, поэтому считается, что они являются одним и тем же файлом, и он и/или Git запутывается, когда он пытается проверить их оба из индекса в файловой системы. Я не удивлюсь, если вы получите обе версии файла, извлеченные из Windows, если вы делаете
git config core.ignorecase false && \
git rm -r . && \
git reset --hard HEAD
Старшие файлы в верхнем регистре должны быть удалены из репо. Сделайте запрос на растяжение для изменений, я уверен, что владельцы проектов будут благодарны.
Старый ответ
Я попробовал это с (Windows) Git по умолчанию core.ignorecase
, установленным в true:
$ git diff --name-only | xargs git rm -f
Это приведет к удалению всех файлов верхнего регистра (и сгенерирует эти изменения в индексе Git), поэтому впоследствии я запустил git status
:
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: etc/apps/phpsysinfo/includes/mb/class.Coretemp.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.HDDTemp.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.HWSensors.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.Healthd.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.IPMI.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.K8Temp.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.LMSensors.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.MBM5.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.MBMon.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.Sensors.inc.php
# deleted: etc/apps/phpsysinfo/includes/ups/class.Apcupsd.inc.php
# deleted: etc/apps/phpsysinfo/includes/ups/class.Nut.inc.php
# deleted: etc/apps/phpsysinfo/plugins/BAT/class.BAT.inc.php
# deleted: etc/apps/phpsysinfo/plugins/BAT/js/BAT.js
# deleted: etc/apps/phpsysinfo/plugins/BAT/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/BAT/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/BAT/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/MDStatus/class.MDStatus.inc.php
# deleted: etc/apps/phpsysinfo/plugins/MDStatus/css/MDStatus.css
# deleted: etc/apps/phpsysinfo/plugins/MDStatus/js/MDStatus.js
# deleted: etc/apps/phpsysinfo/plugins/MDStatus/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/MDStatus/lang/de.xml
# deleted: etc/apps/phpsysinfo/plugins/MDStatus/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/MDStatus/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/PS/class.PS.inc.php
# deleted: etc/apps/phpsysinfo/plugins/PS/js/PS.js
# deleted: etc/apps/phpsysinfo/plugins/PS/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/PS/lang/de.xml
# deleted: etc/apps/phpsysinfo/plugins/PS/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/PS/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/PSStatus/class.PSStatus.inc.php
# deleted: etc/apps/phpsysinfo/plugins/PSStatus/css/PSStatus.css
# deleted: etc/apps/phpsysinfo/plugins/PSStatus/js/PSStatus.js
# deleted: etc/apps/phpsysinfo/plugins/PSStatus/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/PSStatus/lang/de.xml
# deleted: etc/apps/phpsysinfo/plugins/PSStatus/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/PSStatus/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/Quotas/class.Quotas.inc.php
# deleted: etc/apps/phpsysinfo/plugins/Quotas/css/Quotas.css
# deleted: etc/apps/phpsysinfo/plugins/Quotas/js/Quotas.js
# deleted: etc/apps/phpsysinfo/plugins/Quotas/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/Quotas/lang/de.xml
# deleted: etc/apps/phpsysinfo/plugins/Quotas/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/Quotas/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/SMART/class.SMART.inc.php
# deleted: etc/apps/phpsysinfo/plugins/SMART/css/SMART.css
# deleted: etc/apps/phpsysinfo/plugins/SMART/js/SMART.js
# deleted: etc/apps/phpsysinfo/plugins/SMART/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/SMART/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/SMART/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/SNMPPInfo/class.SNMPPInfo.inc.php
# deleted: etc/apps/phpsysinfo/plugins/SNMPPInfo/js/SNMPPInfo.js
# deleted: etc/apps/phpsysinfo/plugins/SNMPPInfo/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/SNMPPInfo/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/SNMPPInfo/lang/pl.xml
# deleted: etc/apps/phpsysinfo/plugins/UpdateNotifier/class.UpdateNotifier.inc.php
# deleted: etc/apps/phpsysinfo/plugins/UpdateNotifier/js/UpdateNotifier.js
# deleted: etc/apps/phpsysinfo/plugins/UpdateNotifier/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/UpdateNotifier/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/UpdateNotifier/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/UpdateNotifier/lang/pl.xml
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: etc/apps/phpsysinfo/includes/mb/class.coretemp.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.hddtemp.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.healthd.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.hwsensors.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.ipmi.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.k8temp.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.lmsensors.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.mbm5.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.mbmon.inc.php
# deleted: etc/apps/phpsysinfo/includes/mb/class.sensors.inc.php
# deleted: etc/apps/phpsysinfo/includes/ups/class.apcupsd.inc.php
# deleted: etc/apps/phpsysinfo/includes/ups/class.nut.inc.php
# deleted: etc/apps/phpsysinfo/plugins/bat/class.bat.inc.php
# deleted: etc/apps/phpsysinfo/plugins/bat/js/bat.js
# deleted: etc/apps/phpsysinfo/plugins/bat/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/bat/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/bat/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/mdstatus/class.mdstatus.inc.php
# deleted: etc/apps/phpsysinfo/plugins/mdstatus/css/mdstatus.css
# deleted: etc/apps/phpsysinfo/plugins/mdstatus/js/mdstatus.js
# deleted: etc/apps/phpsysinfo/plugins/mdstatus/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/mdstatus/lang/de.xml
# deleted: etc/apps/phpsysinfo/plugins/mdstatus/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/mdstatus/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/ps/class.ps.inc.php
# deleted: etc/apps/phpsysinfo/plugins/ps/js/ps.js
# deleted: etc/apps/phpsysinfo/plugins/ps/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/ps/lang/de.xml
# deleted: etc/apps/phpsysinfo/plugins/ps/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/ps/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/psstatus/class.psstatus.inc.php
# deleted: etc/apps/phpsysinfo/plugins/psstatus/css/psstatus.css
# deleted: etc/apps/phpsysinfo/plugins/psstatus/js/psstatus.js
# deleted: etc/apps/phpsysinfo/plugins/psstatus/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/psstatus/lang/de.xml
# deleted: etc/apps/phpsysinfo/plugins/psstatus/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/psstatus/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/quotas/class.quotas.inc.php
# deleted: etc/apps/phpsysinfo/plugins/quotas/css/quotas.css
# deleted: etc/apps/phpsysinfo/plugins/quotas/js/quotas.js
# deleted: etc/apps/phpsysinfo/plugins/quotas/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/quotas/lang/de.xml
# deleted: etc/apps/phpsysinfo/plugins/quotas/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/quotas/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/smart/class.smart.inc.php
# deleted: etc/apps/phpsysinfo/plugins/smart/css/smart.css
# deleted: etc/apps/phpsysinfo/plugins/smart/js/smart.js
# deleted: etc/apps/phpsysinfo/plugins/smart/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/smart/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/smart/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php
# deleted: etc/apps/phpsysinfo/plugins/snmppinfo/js/snmppinfo.js
# deleted: etc/apps/phpsysinfo/plugins/snmppinfo/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/snmppinfo/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/snmppinfo/lang/pl.xml
# deleted: etc/apps/phpsysinfo/plugins/updatenotifier/class.updatenotifier.inc.php
# deleted: etc/apps/phpsysinfo/plugins/updatenotifier/js/updatenotifier.js
# deleted: etc/apps/phpsysinfo/plugins/updatenotifier/lang/cz.xml
# deleted: etc/apps/phpsysinfo/plugins/updatenotifier/lang/en.xml
# deleted: etc/apps/phpsysinfo/plugins/updatenotifier/lang/fr.xml
# deleted: etc/apps/phpsysinfo/plugins/updatenotifier/lang/pl.xml
#
Как вы можете видеть, файлы верхнего регистра устраиваются для фиксации, но теперь мы видим, что есть также файлы в нижнем регистре с одинаковыми именами, но они еще не поставлены.
Итак, я совершил удаление файлов верхнего регистра:
$ git commit -m "Delete upper-case files"
Затем я сделал тяжелый reset:
$ git reset --hard head
Затем я сделал статус и не обнаружил никаких изменений:
$ git status
# On branch master
nothing to commit, working directory clean
И затем, если я делаю find
для одного из файлов нижнего регистра:
$ find . -name class.bat.inc.php
./etc/apps/phpsysinfo/plugins/BAT/class.bat.inc.php
Он все еще находится в рабочем каталоге. Не уверен, что это правильный способ устранить проблему. Я все еще не уверен, в чем суть проблемы. Очевидно, что это имеет какое-то отношение к нечувствительности к файлам в Windows, но почему у пользователей Windows возникают проблемы, а пользователи Unix - нет, я не уверен.
С другой стороны, теперь проект phpsysinfo находится на GitHub вместо репо SVN, авторы zpanelx могут быть заинтересованы в создании подмодуля . Может быть, это поможет избежать такого рода проблем в будущем?
Собственно, может быть, что-то, что вы можете сделать для владельцев проектов? Просто удалите весь ./etc/apps/phpsysinfo
из своего репо, зафиксируйте, а затем добавьте его снова как подмодуль. Нажмите на свое начало, затем сделайте запрос на тягу и вуаля!