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

Re: git object-count differs between clones

From
AMAndrew Martin <amartin@xes-inc.com>
Date
Feb 2, 2016, 17:22 UTC
Message-ID
<1978336183.727736.1454433728105.JavaMail.zimbra@xes-inc.com>
In-Reply-To
<20160202165246.GA17822@sigill.intra.peff.net>
----- Original Message -----
Show 39 quoted lines
> From: "Jeff King" <peff@peff.net>
> To: "Andrew Martin" <amartin@xes-inc.com>
> Cc: "Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>, git@vger.kernel.org
> Sent: Tuesday, February 2, 2016 10:52:46 AM
> Subject: Re: git object-count differs between clones
> 
> On Tue, Feb 02, 2016 at 10:21:17AM -0600, Andrew Martin wrote:
> 
> > > You may try expiring your reflog and "git gc" again.
> > 
> > Thanks, I found some commits that are not referenced in any branch. How can
> > I
> > remove these from the reflog? I tried running
> > "git reflog expire --expire=now --expire-unreachable=now --all" followed by
> > "git gc" but still the same number of objects remain.
> 
> Are the objects now loose, or still in packs? Git has a grace period for
> pruning objects, so that we do not delete objects for an in-progress
> operation. The life cycle of an unreferenced object should be something
> like:
> 
>   - reachable by reflogs, which are pruned after 30 days (or
>     gc.reflogExpireUnreachable config). Objects will be repacked as
>     normal during this time. Override with "reflog expire" as you did
>     above.
> 
>   - after the reflog expires, the objects are now unreachable. During
>     the next repack, they'll be ejected from the pack into loose
>     objects, and their mtimes set to match the pack they came from
>     (which is probably quite recent if you just repacked!).
> 
>   - after 2 weeks (or gc.pruneExpire), unreachable loose objects are
>     dropped by "git prune", which is called as part of "git gc". This is
>     based on the object mtime.
> 
>     You can accelerate this with "git gc --prune=now" (or
>     "--prune=5.minutes.ago").
> 
> -Peff
Jeff,

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?

Thanks,
Andrew
Previous: Jeff KingNext: Jeff King
Message 5 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.