我最近將 package.json 中的所有依賴項升級到最新版本。我從 Angular 12.2.0 升級到 13.0.1,github 現在拒絕我的推送,并顯示以下檔案大小錯誤。是否需要在 angular.json 構建組態檔中定義一些有助于最小化這些快取檔案大小的設定?
remote: warning: File .angular/cache/angular-webpack/72163742903fc8ba00e684045de261c2e3a2fb86/3.pack is 54.01 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File .angular/cache/angular-webpack/72163742903fc8ba00e684045de261c2e3a2fb86/2.pack is 56.42 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: 0b9557fffbe30aac33f6d9858ef97559341c5c1614ace35524fcba85ac99ca76
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File .angular/cache/angular-webpack/72163742903fc8ba00e684045de261c2e3a2fb86/3.pack is 122.06 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File .angular/cache/angular-webpack/72163742903fc8ba00e684045de261c2e3a2fb86/5.pack is 123.92 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File .angular/cache/angular-webpack/f48e9bc724ec0d5ae9a9d2fed858970d0a503f10/0.pack is 154.05 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File .angular/cache/angular-webpack/9327900b3187f0b6351b4801d208e7b58f1af17e/0.pack is 165.50 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File .angular/cache/angular-webpack/663bcd30d50863949acf1c25f02b95cab85c248a/0.pack is 151.56 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File .angular/cache/angular-webpack/663bcd30d50863949acf1c25f02b95cab85c248a/0.pack is 151.55 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
編輯:
我用 Angular cli 創建了這個 repo,并且一直在維護和更新 Angular 的許多版本,直到這個最新更新才出現問題。
.gitignore 檔案位于應用程式的根目錄中,并且與建議的示例相匹配:

添加
/.angular/cache到 gitignore 檔案時,我運行git rm -rf --cached . && git add . && git commit -m 'fix(gitignore): add angular cache' && git push --set-upstream origin chore/bump-deps但仍然收到檔案大小錯誤。
uj5u.com熱心網友回復:
確保您.gitignore在父檔案夾.angular。
在該.gitignore檔案中,一個簡單的.angular/cache/應該足以忽略該子檔案夾的內容。
檢查它:
git check-ignore -v -- .angular/cache/angular-webpack/72163742903fc8ba00e684045de261c2e3a2fb86/2.pack
您可以在ganatan/angular-starter/.gitignore(來自 Angular 13 Example Starter 專案)中看到一個示例,其中/.angular/cache/用于將規則錨定到存盤庫的頂部檔案夾。
該OP S.泰勒證實了評論:
我很確定那是我的問題。
我放棄了dev分支并更新了我的依賴項,而沒有使用像git add . && git commit -m 'fix(gitignore): add angular cache'.
確保注意上演的內容。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/367060.html
上一篇:git-merge在公共裸倉庫中
