From: Teemu Likonen Date: Mon, 12 May 2008 15:52:43 GMT Subject: Re: Why repository grows after "git gc"? / Purpose of *.keep files? Message-ID: <20080512155243.GA3592@mithlond.arda.local> In-Reply-To: <20080512122900.GA13050@mithlond.arda.local> Teemu Likonen wrote (2008-05-12 15:29 +0300): > For testing purposes I deleted objects/pack/*.keep file(s) and ran > "git gc" again. The repo resulted in small again, just like after the > initial clone. After playing with test repo a while it seems that "git gc" never touches pack files which have accompanying .keep file around. (And it's common to have a .keep file after "git clone".) This makes gc perform faster. A side effect seems to be that objects which later become unreferenced in those pack-files-with-.keep are never pruned. *.keep files also seem to prevent from really aggressively optimizing the repository's size. Probably a crazy idea: What if "gc --aggressive" first removed *.keep files and after packing and garbage-collecting and whatever it does it would add a .keep file for the newly created pack?