1. Check which file is too large
remote: Resolving deltas: 100% (24/24), completed with 3 local objects.
remote: warning: File CPT_0707_ao/temp_past/temp2/deltap.csv is 71.69 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: c42ade10239deffc45c2a2800135e242
remote: error: See http://git.io/iEPt8g for more information.
To https://github.com/******
! [remote rejected] master -> master (pre-receive hook declined)
It can be found that the CPT_0707_ao/temp_past/temp2/deltap.csv file is too large and exceeds the 50Mb limit. Then it is this file that needs to be processed.
2. Rewrite commit and delete large files
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch CPT_0707_ao/temp_past/temp2/deltap.csv' --prune-empty --tag-name-filter cat -- --all
3. Push the modified repo
git push origin master
4. Clean up and reclaim space
Although we have deleted the files above, these objects are still retained in our repo, waiting for garbage collection (GC), so we need to use the command to completely clear it and reclaim the space. The command is as follows:
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
solve it completely