我最近将 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.
Run Code Online (Sandbox Code Playgroud)
编辑:
Von*_*onC 35
确保您的文件.gitignore位于的父文件夹中.angular。
在该.gitignore文件中,一个简单的.angular/cache/内容就足以忽略该子文件夹内容。
检查一下:
git check-ignore -v -- .angular/cache/angular-webpack/72163742903fc8ba00e684045de261c2e3a2fb86/2.pack
Run Code Online (Sandbox Code Playgroud)
ganatan/angular-starter/.gitignore您可以在(来自 Angular 13 示例入门项目)中看到一个示例,其中/.angular/cache/使用 来将规则锚定到存储库的顶部文件夹。
OP S. Taylor在评论中确认:
我很确定那是我的问题。
我放弃了dev分支并更新了我的依赖项,而没有使用诸如git add . && git commit -m 'fix(gitignore): add angular cache'.
确保记下上演的内容。
对我来说,问题仍然存在,
我按照以下方式重新配置了 git:
.git/config).git文件夹rm -rf .git
Run Code Online (Sandbox Code Playgroud)
git init
Run Code Online (Sandbox Code Playgroud)
将旧配置 (p.1) 粘贴到新的 git 配置文件 ( .git/config)
在.gitignore添加行中(更多详细信息:angular-starter/.gitignore):
node_modules
.angular/cache
Run Code Online (Sandbox Code Playgroud)
git add . && git commit -m 'update'
Run Code Online (Sandbox Code Playgroud)
git push -f origin HEAD:<new_branch_name>
Run Code Online (Sandbox Code Playgroud)
git push -f origin HEAD:main
Run Code Online (Sandbox Code Playgroud)
git push -f origin HEAD:master
Run Code Online (Sandbox Code Playgroud)
git push -f origin HEAD:<branch_name>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
32825 次 |
| 最近记录: |