From: Junio C Hamano Date: Wed, 29 Jul 2020 18:09:57 GMT Subject: Re: I have gone and done a bad thing - malformed tree objects Message-ID: In-Reply-To: <19cab01d66544$ecb402d0$c61c0870$@pdinc.us> "Jason Pyeron" writes: >> gc and fsck may not have pruned the dangling object yet, but >> --batch-all-objects is a request to enumerate objects that exist in >> the repository, regardless of their reachability from any ref. >> >> Perhaps "git prune --expire=now" would get rid of it? > > Both that and > > git -c gc.reflogExpire=now -c gc.reflogExpireUnreachable=now -c gc.rerereresolved=now -c gc.rerereunresolved=now -c gc.pruneExpire=now -c gc.worktreePruneExpire=now gc --prune=now --aggressive > > leave it in. If the cruft has already been stored in a packfile, then prune would not touch it. "git repack -a -d && git prune --expire=now" would be the next thing to do.