1

我安装了 Git-LFS,如果您检查下面的日志,您会看到 Git-LFS 正在跟踪我尝试上传的所有文件,但仍然给我的文件大于限制错误。那么问题是什么?

C:\***\Immortal-Dawn [Programming +0 ~1 -0 | +126 ~4 -0 !]> git push origin Programming
Counting objects: 152, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (109/109), done.
Writing objects: 100% (152/152), 357.06 MiB | 727.00 KiB/s, done.
Total 152 (delta 85), reused 80 (delta 21)
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: c8d3b4fb7b9d8e6bdb74d5af30a9f9ee
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File ImmortalDawn.sdf is 311.94 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File Plugins/NPC Plugin/Intermediate/Build/Win64/UE4Editor/Development/NPCPluginCore/NPCPluginCorePCH.h.pch is 149.50 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File Plugins/Test/Intermediate/Build/Win64/UE4Editor/Development/Test/TestPrivatePCH.h.pch is 354.06 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File Intermediate/Build/Win64/UE4Editor/Development/ImmortalDawn/ImmortalDawn.h.pch is 698.56 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://***/Immortal-Dawn.git
 ! [remote rejected] Programming -> Programming (pre-receive hook declined)
error: failed to push some refs to 'https://***/Immortal-Dawn.git'

C:\***\Immortal-Dawn [Programming +0 ~1 -0 | +126 ~4 -0 !]> git lfs track
Listing tracked paths
    *.pch (.gitattributes)
    *.sdf (.gitattributes)
    *.sdf,*.pch (.gitattributes)
    *.psd (.gitattributes)
    ImmortalDawn.sdf (.gitattributes)
4

2 回答 2

0

对我来说,文件似乎没有上传到 lfs 位置。如果将文件推送到正确的 lfs 存储,则会得到如下输出:

LFS: 12.58 MB / 12.58 MB  100.00 %

在我看来,您应该检查存储库中的 .gitconfig 文件。应该像这样添加一行:

[lfs "http://User@localhost:7990/scm/plt/reponame.git/info/lfs"]
access = basic

该 URL 在 GitHub 上可能看起来不同。您还应该检查您的存储库(服务器端)是否启用了 LFS。

于 2016-02-08T10:59:08.027 回答
0

我有一个类似的问题,我在 git-lfs 中添加了一些超过大小限制的文件git lfs track,但推送仍然被拒绝。与您的输出的不同之处在于,我得到一行字(例如):

Uploading LFS objects: 100% (88/88), 251 MB | 1.2 MB/s, done.

remote: error: GH001: Large files detected.

当我git lfs track检查被排除的内容时,我得到:

❯ git lfs track
Listing tracked patterns
    *.csv (.gitattributes)
Listing excluded patterns

这与您的输出略有不同(您的说Listing tracked paths和我的说Listing tracked patterns),因此您可能有不同版本的 git-lfs。

至于为什么推送仍然被拒绝,根据这个问题:Failing to push large files · Issue #1933 · git-lfs/git-lfs,您必须先将文件添加到 git-lfs才能将它们添加到 repo

您可以按照该线程中的描述手动重写历史记录,或者使用BFG Repo-Cleaner自动完成(我还没有尝试过......)。

编辑:显然,您可以使用git lfs migrate import将文件添加到已经在 repo 中的 lfs ,而无需重写历史记录:将现有存储库数据迁移到 LFS。另请参阅此 SO 线程:git lfs - What does git lfs migrate do?

于 2020-03-06T12:39:54.827 回答