我已经安装了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)
对我来说,该文件似乎未上传到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。
我有一个类似的问题,其中我使用git lfs track
向git-lfs添加了一些超出大小限制的文件,但仍然拒绝推送。与您的输出不同的是,我得到一行说(例如):
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 在将它们添加到存储库之前>>。
您可以按照该线程中的描述手动重写历史记录,或使用BFG Repo-Cleaner 自动执行历史记录(我尚未尝试过...)。>>