配置 Git LFS 后 Github 桌面中的文件太大警告

Files too large warning in Github Desktop after configuring Git LFS

我在使用 github 桌面时遇到问题,尝试提交时发出 'Files too large' 警告,即使我已经 运行 Git LFS 配置。 总共有 11 个文件导致此问题,它们都在同一个文件夹中。

我安装了 Git LFS 并使用 git bash 将有问题的文件夹添加到 git lfs 轨道,如 here 所述,但不是关联文件类型,我关联了有问题的文件夹目录。

完成此操作并验证 .gitattributes 文件确实已更改后,我尝试再次使用 github 桌面提交待处理的更改列表。

问题: 我仍然收到来自 GitHub Desktop 的警告,说文件太大,并建议我应该改用 Git LFS。

我该如何解决?

编辑 1:添加图片: 编辑 2:推送 -> 提交

听起来您已经将大文件提交到本地正常的 git 存储库。您需要使用 git rebasegit filter-branch.

编辑您的提交

but instead of associating a file type, I associated the problematic folder directory

我建议你不要这样做,因为它明确指出:

To associate a file type in your repository with Git LFS, enter git lfs track followed by the name of the file extension you want to automatically upload to Git LFS. source

运行 而不是 git lfs track '<problematic folder>/*.dll'。事实上,.gitattributes 默认情况下不会递归跟踪嵌套文件夹 - 正如 issue #3963 中所建议的那样。

The rules by which the pattern matches paths are the same as in .gitignore files (see gitignore[5]), with a few exceptions:

  • negative patterns are forbidden

  • patterns that match a directory do not recursively match paths inside that directory (so using the trailing-slash path/ syntax is pointless in an attributes file; use path/** instead) source

另见 issue #2214