【问题标题】:Push large file without git lfs在没有 git lfs 的情况下推送大文件
【发布时间】:2021-08-20 11:13:01
【问题描述】:

我尝试在 github 上提交对我的项目的更改。我已将领域数据库添加到我的项目中,现在提交太大了。我已经读过我需要使用 github 大文件,但要做到这一点,我需要在我的 mac 上安装自制软件。问题是我没有足够的内存来执行此操作。

我在 github 上找到一篇文章,人们建议通过 Xcode swift 包管理器安装 Realm(现在我使用可可豆荚),然后它不应该那么大。但我想知道在一个项目中使用可可豆荚(我需要它来做其他一些事情)和 swift 包管理器是否存在问题?

当我尝试提交时,我会收到此警报

Pods/Realm/core/realm-monorepo.xcframework/watchos-armv7k_arm64_32/librealm-monorepo.a is 76.01 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB

Pods/Realm/core/realm-monorepo.xcframework/ios-arm64_x86_64_i386-simulator/librealm-monorepo.a is 68.40 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB

Pods/Realm/core/realm-monorepo.xcframework/tvos-arm64_x86_64-simulator/librealm-monorepo.a is 53.93 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB

Pods/Realm/core/realm-monorepo.xcframework/ios-armv7_arm64/librealm-monorepo.a is 77.82 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB

【问题讨论】:

  • “问题是我没有足够的内存来执行此操作。”在这一点上,这成为一个硬件问题。如果您的记忆力如此之小,那么您已经被水洗了。这不是一个可行的开发环境。
  • 您不应该首先将签出的依赖项提交给 git。看看你在使用 Cocoapods 时应该和不应该提交的内容。
  • 把你的大文件放在你的忽略列表中。

标签: swift git github realm


【解决方案1】:

首先,自制软件不会太大,以至于您可能会用完存储空间(我假设您的意思是存储空间,而不是内存)。

此外,您可以选择仅提交某些文件。你可以参考这个答案——Git: How to ignore certain files in Git

最后,同时使用 Cocoapods 和 Swift 包管理器应该没有任何问题。我有多个这样做的项目,完全没有遇到任何问题。

【讨论】:

    猜你喜欢
    • 2021-12-22
    • 2012-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-26
    • 1970-01-01
    • 2022-01-23
    • 2023-02-02
    相关资源
    最近更新 更多