Re: Is there a way to control the number of revisions will be saved by git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt <j.sixt@xxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux