git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Tzury Bar Yochay <tzury.by@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Is there a way to control the number of revisions will be saved by git
Date: Wed, 03 Dec 2008 12:22:43 +0100	[thread overview]
Message-ID: <49366C03.5080506@viscovery.net> (raw)
In-Reply-To: <2f5ea7490812030301p29e944fw5f59943dc352cd09@mail.gmail.com>

Tzury Bar Yochay schrieb:
> Hello Happy Gitters,
> 
> Say I wish to save only 100 generations back (per branch).
> Is it possible to configure git so it will save only N records back.

No.

> If git cannot be configured for that, Is there a way to shrink the repository
> manually so it will contain the last N generations?

Yes:

  $ git rev-parse HEAD~$N >> .git/info/grafts
  $ git filter-branch HEAD

This assumes that your history is strictly linear and you do not have
tags. It also rewrites the $N commits so that they now have different
SHA1s. For this reason, don't share this repository with anyone - it leads
to confusion.

-- Hannes

  reply	other threads:[~2008-12-03 11:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03 11:01 Is there a way to control the number of revisions will be saved by git Tzury Bar Yochay
2008-12-03 11:22 ` Johannes Sixt [this message]
2008-12-03 12:58   ` Jakub Narebski
2008-12-03 13:40     ` Miklos Vajna
2008-12-03 11:37 ` Arafangion
2008-12-03 13:04   ` Jean-Luc Herren
2008-12-03 12:47 ` Tzury Bar Yochay
2008-12-03 18:20 ` Tzury Bar Yochay
2008-12-03 18:23   ` Tzury Bar Yochay

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=49366C03.5080506@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=tzury.by@gmail.com \
    /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).