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

Re: Is there a way to trim old SHAs from a git tree (so it's not so large)?

From
TKThomas Kolejka <thomas.kolejka@gmx.at>
Date
Nov 17, 2006, 10:36 UTC
Message-ID
<20061117103611.183640@gmx.net>
In-Reply-To
<455B90AD.3060707@freescale.com>
-------- Original-Nachricht --------
Datum: Wed, 15 Nov 2006 16:11:57 -0600
Von: Timur Tabi <timur@freescale.com>
An: git@vger.kernel.org
Betreff: Is there a way to trim old SHAs from a git tree (so it\'s not so large)?
Show 16 quoted lines
> After doing a "make mrproper" in my Linux git tree, the result is still
> 1.1GB 
> of files.  Compare that with just the tarball, which is just one-forth the
> size.
> 
> Is there a way to "trim away" old commits from the repository, so that it
> just 
> doesn't take up that much space?  I don't care about any commits made in
> 2005. 
>   As long as I can still do "git pull" from the source repo to update
> mine, 
> that's good enough.
> 
> -- 
> Timur Tabi
> Linux Kernel Developer @ Freescale

Is it possible to do this with shallow clone? Shallow clone the local repository my.git (which should be trimmed) starting from the last needed commit to a new local repository my_trimmed.git. And then remove my.git (with something like rm -rf my.git) and rename my_trimmed.git to my.git?

Thomas
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Previous: Shawn PearceNext: Timur Tabi
Message 5 of 19 in “Is there a way to trim old SHAs from a git tree (so it's not so large)?”
  1. Timur TabiNov 15, 2006
  2. Shawn PearceNov 15, 2006
  3. Timur TabiNov 15, 2006
  4. Shawn PearceNov 15, 2006
  5. Thomas KolejkaNov 17, 2006
  6. Timur TabiNov 21, 2006
  7. Shawn PearceNov 21, 2006
  8. Timur TabiNov 21, 2006
  9. Shawn PearceNov 21, 2006
  10. Timur TabiNov 21, 2006
  11. Shawn PearceNov 21, 2006
  12. Timur TabiNov 21, 2006
  13. Johannes SchindelinNov 21, 2006
  14. Timur TabiNov 21, 2006
  15. Jakub NarebskiNov 21, 2006
  16. Johannes SchindelinNov 21, 2006
  17. Timur TabiNov 21, 2006
  18. Jakub NarebskiNov 21, 2006
  19. Johannes SchindelinNov 21, 2006

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.