git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: collapsing old git history to reduce repo size, while preserving commit #s and tags

From
Andrew Ardill <andrew.ardill@gmail.com>
Date
Oct 29, 2013, 22:52 UTC
Message-ID
<CAH5451=DGp0aRaA6c-ThO0Aj0VCAUFX17p8gOKPpURwEnjcpdA@mail.gmail.com>
In-Reply-To
<CAJSXqrqz3KeiPKWz6rFKb4o0F88o9=63Sv37MJSp5qmYtod-6A@mail.gmail.com>
On 29 October 2013 15:42, Stas Cherkassky <scherkas@gmail.com> wrote:
> I'd like to clone the repo to the new project and "slim it down"
> I'd like to collapse 900 first commits into one, but keep last 100,
> with their commit numbers and tags. I also want to be able to push and
> merge changes from the old repo to the new one.

If you want to change the actual history of your repository, it will be largely incompatible with the original, and this is by design. You don't want somebody being able to change your history without you knowing about it.

> I've read about git rebase, but it seems to tamper with commit numbers
> and looses tags.. Is there any other way to have it done ?

It sounds like a shallow checkout might be appropriate for you, try looking that up.

Regards,
Andrew Ardill
Previous: Stas CherkasskyNext: Stas Cherkassky
Message 2 of 5 in “Re: collapsing old git history to reduce repo size, while preserving commit #s and tags”
  1. Stas CherkasskyOct 29, 2013
  2. Andrew ArdillOct 29, 2013
  3. Stas CherkasskyOct 30, 2013
  4. Jakub NarębskiOct 30, 2013
  5. Duy NguyenOct 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.