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

Re: Unable to shrink repository size

From
Elijah Newren <newren@gmail.com>
Date
Mar 6, 2014, 05:21 UTC
Message-ID
<CABPp-BGPPj63zLjjp5R6+vpJr3nLX_aSCz34qCf2E8tm8J7EDQ@mail.gmail.com>
In-Reply-To
<CAHd499AW6nev81iVVhuoYfT0us28SSBDwbHCBa3teYB=cJR99g@mail.gmail.com>
On Wed, Mar 5, 2014 at 6:55 PM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
Show 10 quoted lines
> What I'd like to do is somehow hunt down the largest commit (*not*
> blob) in the entire history of the repository to hopefully find out
> where huge directories have been checked in.
>
> I can't do a search for largest file (which most google results seem
> to show to do) since the culprit is really thousands of unnecessary
> files checked into a single subdirectory somewhere in history.
>
> Can anyone offer me some advice to help me reduce the size of my repo
> further? Thanks.
If you are trying to see which commits changed the most files (and/or
lines), you may find
   git log --oneline --shortstat
helpful.  A quick search through that output may help you decide where
to dig further.

Also, I'm sure someone else here probably has a better idea, but here's a quick hack I came up with to look at "commit sizes":

mkdir tmp && for i in $(git rev-list --all); do git branch -f dummy $i && git bundle create tmp/$i.bundle dummy --not dummy^@; done

Follow that up with a quick "ls -alrSh tmp/" and you can see the "size" of each commit.

Hope that helps, Elijah

Previous: Robert DaileyNext: Fredrik Gustafsson
Message 2 of 5 in “Unable to shrink repository size”
  1. Robert DaileyMar 6, 2014
  2. Elijah NewrenMar 6, 2014
  3. Fredrik GustafssonMar 6, 2014
  4. Duy NguyenMar 6, 2014
  5. Jeff KingMar 6, 2014

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.