From: Jakub Narebski <jnareb@gmail.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: "John M. Dlugosz" <ngnr63q02@sneakemail.com>, git@vger.kernel.org
Subject: Re: Purging old history
Date: Sat, 31 Mar 2012 01:25:27 -0700 (PDT) [thread overview]
Message-ID: <m37gy1b2j0.fsf@localhost.localdomain> (raw)
In-Reply-To: <CALkWK0=mcQR3CBMpa5P1f+JwqNMqUs3D4=tVPx4c_4R+TXCKbw@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> John M. Dlugosz wrote:
> > Is there a simple way to delete old commits, say beyond a certain age,
> > before putting it on the server? The ancient stuff is not relevant and
> > there are a lot of binaries. Some users may have trouble with an extensive
> > download when syncing the first time.
It seems that you have XY problem.
One solution to extensive initial download is to create a git-bundle
of all commits up to e.g. some tag, and host it using HTTP, FTP
(which are resumable), or even P2P like BitTorrent.
Another solution would be to educate users to use shallow clones,
i.e. use "--depth" option to git-clone... and help git developers make
shallow clones better (there are some unncessary limitations in using
shallow clones).
> Yes, although your terminology is wrong: it's not about "deleting"
> commits; simply create a fresh root commit and rebase your work on top
> of it. As an example, let's say you want to squash history from the
> 67afe1 (the old root) to 7ef42b on the master branch:
>
> $ git checkout -b newroot 7ef42b
> $ git reset 67afe1
> $ git add .
> $ git commit --amend
> $ git checkout master
> $ git rebase --onto newroot 7ef42b
A simpler solution, one that would work also in presence of merges, is
to use grafts mechanism (see gitrepository-layout(5)) to cauterize
history, check using git-log or gitk that shortened history is
correct, make grafts permanent altering history with
git-filter-branch, and finally removing grafts.
P.S. Please read first all the warnings about rewriting history, and
about all its disadvantages for downstream.
--
Jakub Narebski
next prev parent reply other threads:[~2012-03-31 8:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-31 4:25 Purging old history John M. Dlugosz
2012-03-31 4:43 ` Ramkumar Ramachandra
2012-03-31 8:25 ` Jakub Narebski [this message]
2012-03-31 20:20 ` Phil Hord
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=m37gy1b2j0.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=ngnr63q02@sneakemail.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).