0

I got a large file error, so I did git rm to remove that file. However, I got the error stating that I still have that (deleted) file:

Enumerating objects: 121, done.
Counting objects: 100% (121/121), done.
Delta compression using up to 96 threads
Compressing objects: 100% (85/85), done.
Writing objects: 100% (118/118), 130.17 MiB | 6.88 MiB/s, done.
Total 118 (delta 24), reused 0 (delta 0)
remote: Resolving deltas: 100% (24/24), completed with 3 local objects.
remote: error: Trace: be26c85ac452f89c22c9a8cfac4f717bacac2dc3dfca32ef5afac4fff716d574
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File MRI_augmentation/voxelmorph/previous_git/objects/pack/pack-e1d134b06d29bdb05cafe53b8f74149afa3b5e37.pack is 129.18 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/Transconnectome/VAE_ADHD.git
 ! [remote rejected] try_combine -> try_combine (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/Transconnectome/VAE_ADHD.git'

can anyone please tell me why this is happening and how I can fix it? thank you in advance!

Danny Han
  • 177
  • 3
  • 9
  • Search for "remove file from git history". – robertklep Nov 10 '22 at 13:40
  • Thank you so much! I didn't know what to search but I think I can try your suggestion! – Danny Han Nov 10 '22 at 13:48
  • I tried the git filter branch but still got the same error – Danny Han Nov 10 '22 at 13:50
  • ```git filter-branch --index-filter \ > 'git rm -rf --cached --ignore-unmatch MRI_augmentation' HEAD ``` was what I used – Danny Han Nov 10 '22 at 13:50
  • when I tried again to specify the file itself (instead of the directory) that was causing the trouble using `it filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch MRI_augmentation/voxelmorph/previous_git/objects/pack/pack-e1d134b06d29bdb05cafe53b8f74149afa3b5e37.pack' HEAD`, I got the error : `Cannot create a new backup. A previous backup already exists in refs/original/ Force overwriting the backup with -f` – Danny Han Nov 10 '22 at 13:51
  • Thank you! I'll study more and try to solve this – Danny Han Nov 10 '22 at 14:08

0 Answers0