git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yuri D'Elia <wavexx@thregr.org>
To: git@vger.kernel.org
Subject: Thinning a repository
Date: Sun, 30 Nov 2014 13:18:34 +0100	[thread overview]
Message-ID: <m5f1uq$na7$1@ger.gmane.org> (raw)

Hi everyone,

Is there a quick way to reproduce the effect of a shallow clone on a
local repository that doesn't involve filter-branch and/or re-clone?

My motivation is to reduce the local size of repositories I'm only
following, by trimming the history without prejudice to a [N] set of
last commits. It feels stupid that the quickest way I'm aware of right
now to achieve this is to "git clone --depth N ..." again. filter-branch
is ridiculously slow, as it iterates through history.

I've tried using graft points, but the combination of:

echo [sha] > .git/info/grafts
git reflog expire --expire=0 --all
git repack -Ad

doesn't really save any space and/or reduce the object count as I would
expect. It means there's probably still reachable?

I'd really love to have a 'git thin [depth]' subcommand to perform the
above however. I don't really want to have to iterate through refs just
to check if they are still reachable within [n] commits just to delete them.

Thanks for any pointer.

             reply	other threads:[~2014-11-30 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30 12:18 Yuri D'Elia [this message]
2014-11-30 12:34 ` Thinning a repository Fredrik Gustafsson
2014-11-30 12:35   ` Yuri D'Elia

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='m5f1uq$na7$1@ger.gmane.org' \
    --to=wavexx@thregr.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).