无法在 git 中推送分支

问题描述

我正在 Ruby on Rails 上做项目。无法将提交推送到 git,尝试 git push 时总是出现此错误

Total 139 (delta 88),reused 0 (delta 0)
remote: Resolving deltas: 100% (88/88),completed with 19 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 58c751c4cd45f96f1386eb4f97b40fbf0308ae1434a6617d6c403bd8
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File public/uploads/tmp/1612375485-393249634478175-0006-2847/slack is 126.59 MB; this exceeds GitHub's file size limit of 100.00 MB

 ! [remote rejected] main -> main (pre-receive hook declined)
error: Failed to push some refs to 'https://github.com/*****

我试图在 tmp 文件夹中找到这个文件,然后删除。但是我再次收到此错误

解决方法

你应该首先从你的 git repo 中删除这个文件。

https://devconnected.com/how-to-remove-files-from-git-commit/

因为它已经被隐藏并提交了。

如果需要,您可以将其保留在本地(只需在完成后将其添加到忽略的文件中即可)