Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git gc fatal error bad object refs/remotes/origin/deleted/deleted.002

Tags:

git

When I run git gc, I get this error

fatal: bad object refs/remotes/origin/deleted/deleted.002

fatal:failed to run repack

Everything else is fine, only git gc gives the problem

like image 925
Abhishek Agrawal Avatar asked Oct 14 '25 12:10

Abhishek Agrawal


1 Answers

To fix this I went and deleted the reference by deleting the file .git/refs/remotes/origin/deleted/deleted.002

deleted is a system directory and won't be visible directly. so just open the file using the path or use command prompt to delete the file.

You can save a copy also if you want restore the file later

like image 82
Abhishek Agrawal Avatar answered Oct 17 '25 02:10

Abhishek Agrawal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!