All of lore.kernel.org
 help / color / mirror / Atom feed
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
Subject: Re: git object-count differs between clones
Date: Tue, 2 Feb 2016 11:52:46 -0500	[thread overview]
Message-ID: <20160202165246.GA17822@sigill.intra.peff.net> (raw)
In-Reply-To: <203317792.714602.1454430077194.JavaMail.zimbra@xes-inc.com>

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

  reply	other threads:[~2016-02-02 16:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <57434188.709288.1454428054374.JavaMail.zimbra@xes-inc.com>
2016-02-02 15:52 ` git object-count differs between clones Andrew Martin
2016-02-02 16:09   ` Matthieu Moy
2016-02-02 16:21     ` Andrew Martin
2016-02-02 16:52       ` Jeff King [this message]
2016-02-02 17:22         ` Andrew Martin
2016-02-03  4:34           ` Jeff King
2016-02-03 15:21             ` Andrew Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160202165246.GA17822@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=amartin@xes-inc.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.