0

How do i get pathspec of my file that is large so i can git rm it.

I tried to git push, and i get this error

remote: error: Trace: b298188f3f1fd59ef95f0ba87fb8749931bf244fc08098ecf345c1ab925b1d7f
remote: error: See https://gh.io/lfs for more information.
remote: error: File bootstrap.zip is 178.58 MB; this exceeds GitHub's file size limit of 100.00 MB

I deleted bootstrap.zip but still cant push.

I used git filter

git filter-branch -f --index-filter 'PATHS=`git ls-files -s | sed "s/^engine//"`; \
>> GIT_INDEX_FILE=$GIT_INDEX_FILE.new; \
>> echo -n "$PATHS" | \
>> git update-index --index-info \
>> && if [ -e "$GIT_INDEX_FILE.new" ]; \
>>   then mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"; \
>> fi' -- --all

it run successfully but still i cant push.

I added /bootstrap.zip in .gitignore file in my project but still cant push

I tried git rm -f bootsrtap.zip, but gets error, pathspec

i have tried to follow a lot of suggestion but i cant get through

upcoming
  • 11
  • 7
  • 1
    What is your `filter-branch` command supposed to do? It is not deleting the big file – knittl May 28 '23 at 08:53
  • @knittl i guess it is suppose to filter and rebase my repo – upcoming May 28 '23 at 09:52
  • 1
    Your file is `bootstrap.zip`. You should be able to delete it with `git rm --ignore-unmatch bootstrap.zip` or `git rm --ignore-unmatch '*bootstrap.zip'` (the quotes are important) – knittl May 28 '23 at 11:05
  • @knittl, thanks for your reply. I ran both git rm. it appeared as if all was good. so i git branch -M main and git push -u origin main. I get the same error of large file bootstrap.zip – upcoming May 28 '23 at 18:57
  • No, you have to delete the file from _all_ commits (as is explained by the linked duplicate). I just wanted to point out how to delete the file in a filter-branch script – knittl May 28 '23 at 19:10
  • @knittl, i followed it $ java -jar bfg.jar --strip-blobs-bigger-than 100M https://github.com/oziomadot/OPAAM.git. I got this error java : The term 'java' is not recognized as the name of a cmdlet, function, script file, or operable program. – upcoming May 28 '23 at 19:26
  • 1
    There are many solutions without BFG (which requires Java to be installed) in the linked dupe: https://stackoverflow.com/a/30274113/112968, https://stackoverflow.com/a/2158271/112968, https://stackoverflow.com/a/61602985/112968, https://stackoverflow.com/a/43640996/112968. It helps to not stop reading after the first answer. – knittl May 28 '23 at 19:44

0 Answers0