Thread (9 messages) flat view 9 messages, 6 authors, 2016-06-15

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

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:45:43

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help