Is there a way or command to delete a blob from git using its ID
I used the command
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | grep '^[^ ]* blob' | cut -d" " -f1,3-
And got the list of blobs in all versions like
62f7e0df0b80bce8d0a4cb388be8988df1bec5ef NodeApplication/NodeApplication/public/javascripts/homescript.js
b1d69387fbd4d4e84bbe9eb2c7f59053c0355e11 NodeApplication/NodeApplication/iisnode/index.html
624642d6f2a86844dc145803260537be0fe40090 NodeApplication/NodeApplication/.ntvs_analysis.dat
Now I want to delete the blob
NodeApplication/NodeApplication/.ntvs_analysis.dat.
How can I do that?
I used BFG cleaner to clean the unwanted big files and then did
git reflog expire --expire=now --all
git gc --aggressive --prune=now
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With