git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git object-count differs between clones

From
Jeff King <peff@peff.net>
Date
Feb 3, 2016, 04:34 UTC
Message-ID
<20160203043411.GB21561@sigill.intra.peff.net>
In-Reply-To
<1978336183.727736.1454433728105.JavaMail.zimbra@xes-inc.com>
On Tue, Feb 02, 2016 at 11:22:08AM -0600, Andrew Martin wrote:
> Thanks for the clarification. I now ran "git repack -A" followed by 
> "git gc --prune=now", however I am still seeing the same number of objects. What
> else can I try to successfully mark these and unreachable and garbage collect them?

That should clear out any unreachable objects. Are we sure that the objects in question are, in fact, unreachable?

Try:
  git rev-list --objects --all --reflog | wc -l

which should give a count of reachable objects. I'd expect that to line up with that "git count-objects -v" reports after having run your gc above.

In your original email, the discrepancy was between your "original" repository and the one that had round-tripped to a clone. Is it possible there are refs in the original that did not get pushed? Try comparing "git for-each-ref" in each repository.

We also consider objects in the index to be reachable for packing. Could your original perhaps have some uncommitted objects mentioned in the index?

-Peff
Previous: Andrew MartinNext: Andrew Martin
Message 6 of 7 in “git object-count differs between clones”
  1. Andrew MartinFeb 2, 2016
  2. Matthieu MoyFeb 2, 2016
  3. Andrew MartinFeb 2, 2016
  4. Jeff KingFeb 2, 2016
  5. Andrew MartinFeb 2, 2016
  6. Jeff KingFeb 3, 2016
  7. Andrew MartinFeb 3, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.