* Thinning a repository
@ 2014-11-30 12:18 Yuri D'Elia
2014-11-30 12:34 ` Fredrik Gustafsson
0 siblings, 1 reply; 3+ messages in thread
From: Yuri D'Elia @ 2014-11-30 12:18 UTC (permalink / raw)
To: git
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Thinning a repository
2014-11-30 12:18 Thinning a repository Yuri D'Elia
@ 2014-11-30 12:34 ` Fredrik Gustafsson
2014-11-30 12:35 ` Yuri D'Elia
0 siblings, 1 reply; 3+ messages in thread
From: Fredrik Gustafsson @ 2014-11-30 12:34 UTC (permalink / raw)
To: Yuri D'Elia; +Cc: git
On Sun, Nov 30, 2014 at 01:18:34PM +0100, Yuri D'Elia wrote:
> 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?
I'm curious, why is it a bad thing to do a re-clone? If you clone your
local repo it would be really fast.
--
Med vänlig hälsning
Fredrik Gustafsson
tel: 0733-608274
e-post: iveqy@iveqy.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Thinning a repository
2014-11-30 12:34 ` Fredrik Gustafsson
@ 2014-11-30 12:35 ` Yuri D'Elia
0 siblings, 0 replies; 3+ messages in thread
From: Yuri D'Elia @ 2014-11-30 12:35 UTC (permalink / raw)
To: git
On 11/30/2014 01:34 PM, Fredrik Gustafsson wrote:
> On Sun, Nov 30, 2014 at 01:18:34PM +0100, Yuri D'Elia wrote:
>> 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?
>
> I'm curious, why is it a bad thing to do a re-clone? If you clone your
> local repo it would be really fast.
I see no reason to involve the workspace.
I would also want to keep the current remote/origin as it is.
I expect a 'thin' command to be faster by not touching the workspace at all.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-30 12:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-30 12:18 Thinning a repository Yuri D'Elia
2014-11-30 12:34 ` Fredrik Gustafsson
2014-11-30 12:35 ` Yuri D'Elia
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).