git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Tzury Bar Yochay <tzury.by@gmail.com>, 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 04:58:40 -0800 (PST)	[thread overview]
Message-ID: <m3ljuxifer.fsf@localhost.localdomain> (raw)
In-Reply-To: <49366C03.5080506@viscovery.net>

Johannes Sixt <j.sixt@viscovery.net> writes:
> Tzury Bar Yochay schrieb:

> > 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.

Why would you want that, by the way?

> 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.

Or just use shallow clone

  git clone --depth <depth> <repository>

to have new copy (clone) of <repository> to have only <depth> commits
back.  See man git-commit; but it might be not what you want.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2008-12-03 13:00 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
2008-12-03 12:58   ` Jakub Narebski [this message]
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=m3ljuxifer.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --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).