下面是我在 .gitignore 中添加的條目以排除 Load.php 檔案,以便跟蹤對該檔案的任何更改。我似乎沒有在我的規則中發現錯誤。請幫我弄清楚。
檔案路徑:public_html/vendor/magento/zendframework1/library/Zend
/public_html/vendor
!/public_html/vendor/magento
/public_html/vendor/magento/*
!/public_html/vendor/magento/zendframework1
/public_html/vendor/magento/zendframework1/*
!/public_html/vendor/magento/zendframework1/library
/public_html/vendor/magento/zendframework1/library/*
!/public_html/vendor/magento/zendframework1/library/Zend
/public_html/vendor/magento/zendframework1/library/Zend/*
!public_html/vendor/magento/zendframework1/library/Zend/Loader.php
uj5u.com熱心網友回復:
至少添加!/public_html/vendor/*/:
/public_html/vendor/*
!/public_html/vendor/*/
!public_html/vendor/magento/zendframework1/library/Zend/Loader.php
(后面沒有斜杠Loader.php,因為它是一個檔案,而不是一個檔案夾)
如果您不將檔案夾(此處為 的子檔案夾vendor/)列入白名單,您將無法排除檔案,因為父檔案夾會被忽略。
一般規則是:
如果排除了該檔案的父目錄,則無法重新包含該檔案。
仔細檢查git check-ignore -v -- path/to/file
此外,請確保該檔案尚未被跟蹤:
cd /path/to/repository
git rm --cached -- public_html/vendor/magento/zendframework1/library/Zend/Loader.php
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/511439.html
上一篇:無法安裝Magento
