gitee reports an error when uploading a file that is too large: remote: error: File: 05530da3156606068d91f1248bc14556ab11436d 261.69 MB, exceeds 100.0

1. Problem analysis

When uploading to Gitee, a single file has a maximum limit of 100MB. If a file exceeds 100MB, it will cause (plug-in) upload timeout or (command line upload) error. I reported this error locally because: there are many animated Gif files, among which A GIF file is 261.69 MB. After compression, use the command line to upload. If a single file exceeds 50 MB, a warning will appear, but it will not affect the upload. When uploading a plug-in, there will be no warning.

2. Solution

1. First follow the prompt command to find out which file exceeds the file limit.

git rev-list --objects --all | grep 报错文件代码

For example, my error file code is: 05530da3156606068d91f1248bc14556ab11436d 

Then you should enter the following command: 

git rev-list --objects --all | grep 05530da3156606068d91f1248bc14556ab11436d 

2. If nothing else happens, something will happen here. . .

Enter the above command, if this error is reported:grep is not an internal or external command, an operable program or batch file.

Reason: grep is a command under Linux system, and Windows does not support this command.

Solution: Just replace grep with findstr , re-enter the command:

git rev-list --objects --all | findstr 报错文件代码

3. The above command will obtain the relative path of the problem file. Enter the following command to delete it from the git cache:

git filter-branch -f --prune-empty --index-filter "git rm -rf --cached --ignore-unmatch 文件相对路径复制到这里" --tag-name-filter cat -- --all

 4. After deletion, clear the local cache

git gc --prune=now

5. Finally re-commit+push

3. Small suggestions

Static resources such as animated images can be compressed to less than 50MB as much as possible to avoid being unable to upload to gitee or causing page loading to be slow and stuck.

Guess you like

Origin blog.csdn.net/weixin_48082900/article/details/133993494