首页 > 解决方案 > 无法推送 github 大小限制

问题描述

我使用 Cocoapods 安装了 GoogleMaps pod。我尝试提交我的更改并推送到 github。然后弹出大小限制错误,我知道我必须将 GoogleMaps 文件夹保留在 gitignore 文件中。

我添加到我的 .gitignore 文件中: Pods/GoogleMaps/

在终端:

git rm -r --cached . 
git add .

如果我尝试查看 GoogleMaps 文件夹是否被忽略,我会得到以下信息:

git check-ignore -v Pods/GoogleMaps         
.gitignore:1:Pods/GoogleMaps/   Pods/GoogleMaps

如果我尝试推到原点:

remote: error: Trace: c08289a82c9c540047ad0d396caa72f8f143a62e098c82c96a7de884eddf7c59
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework/GoogleMapsCore is 134.89 MB; this exceeds GitHub's file size limit of 100.00 MB

大小限制也有同样的问题。有谁知道我该如何解决这个问题?

编辑:

我试过了 git rm --cached Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework/GoogleMapsCore

我得到: fatal: specified route 'Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework/GoogleMapsCore' folder not found

编辑2:

我做了 git reset 到我添加这些文件的提交。删除它们并提交。关于大小限制的相同消息。我不明白为什么我在上次提交之前删除了文件。

标签: gitgithub

解决方案


你可以试试这个:git reset HEAD Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework/GoogleMapsCore


推荐阅读