git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gelonida <gelonida@gmail.com>
To: git@vger.kernel.org
Cc: git@vger.kernel.org
Subject: Re: how to delete the entire history before a certain commit
Date: Tue, 04 May 2010 01:58:20 +0200	[thread overview]
Message-ID: <4BDF631C.8010800@gmail.com> (raw)
In-Reply-To: <m3k4rkft7k.fsf@localhost.localdomain>

Hi Jakub,

Jakub Narebski wrote:
> Gelonida <gelonida@gmail.com> writes:
>> Jakub Narebski wrote:
>>> Gelonida <gelonida@gmail.com> writes:
>>>
>>>> We have a git repository, whose size we want to reduce drastically 


>>> If you want to simply _remove_ history before specified commit,
>>> instead of squashing it, the best solution would be to use grafts to
>>> cauterize (cut) history, check using [graphical] history viewer that
>>> you cut it correctly, and then then use git-filter-branch to make this
>>> cut permanent.

> You can read about grafts in git-filter-branch(1) manpage, in
> gitrepository-layout(5) git repository layout description, and in
> gitglossary(7) a git glossary.
> 
> In short, each line in .git/info/grafts consist of sha1 id of object,
> followed by space-separated list of its effective (grafted) parents.
> So to cut history e.g. after commit a3eb250f996bf5e, you need to put
> line containing only this SHA-1 in .git/info/grafts file, e.g.:
> 
>   $ git rev-parse --verify a3eb250f996bf5e >> .git/info/grafts
>  
>> So the command to look for is git-filter-branch, right ?
>> I'll read the doc.
> 
> 
> As you would see in git-filter-branch(1) documentation, simple
> 
>   $ git filter-branch --all


The command
git filter-branch --all
did not work for me. it just fdisplays the help text.

however without '--all'
git filter-branch

seems to have worked.

Thanks a lot :-)

      reply	other threads:[~2010-05-03 23:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 22:23 how to delete the entire history before a certain commit Gelonida
2010-05-03 22:45 ` Jakub Narebski
2010-05-03 23:11   ` Gelonida
2010-05-03 23:42     ` Jakub Narebski
2010-05-03 23:58       ` Gelonida [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=4BDF631C.8010800@gmail.com \
    --to=gelonida@gmail.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 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).