From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: Joshua Jensen <jjensen@workspacewhiz.com>,
weigelt@metux.de, git@vger.kernel.org
Subject: Re: Cutting history
Date: Sat, 10 Jul 2010 20:12:01 +0000 [thread overview]
Message-ID: <AANLkTilcw6gpGI1TO_iRmComID3n0w2biox0ac1uzNyU@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikY8RKseD8K4RVrLHnSdW_Su8hVRPRFkzzz1rGv@mail.gmail.com>
On Sat, Jul 10, 2010 at 11:58, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> As for pruning old history, I thought this *should* work for pruning
> history older than 7 days (given that you dump daily):
>
> git rebase --strategy=base --onto master~8 master~7
>
> But of course that deletes new commits. I need to freshen up on my
> rebase understanding. Maybe someone else on list knows how to do
> that. I thought git rebase --interactive might work, but I can't get
> it to display the root commit. Maybe you need git-filter-branch.
Thiago Macieira on #git provided the answer. You can do that with
grafts and git filter-branch. E.g. rewriting the history so that you
only have the 7 latest commits:
git rev-list HEAD | sed '7q;d' > .git/info/grafts &&
test -s .git/info/grafts &&
git filter-branch -f HEAD
prev parent reply other threads:[~2010-07-10 20:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-10 3:25 Cutting history Enrico Weigelt
2010-07-10 4:08 ` Joshua Jensen
2010-07-10 6:43 ` Chris Frey
2010-07-10 8:47 ` Jakub Narebski
2010-07-10 10:40 ` Martin Pettersson
2010-07-10 11:58 ` Ævar Arnfjörð Bjarmason
2010-07-10 20:12 ` Ævar Arnfjörð Bjarmason [this message]
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=AANLkTilcw6gpGI1TO_iRmComID3n0w2biox0ac1uzNyU@mail.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=jjensen@workspacewhiz.com \
--cc=jnareb@gmail.com \
--cc=weigelt@metux.de \
/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).