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

Re: Reducing Git Repository size - git-filter-repo doesn't help

From
EEErik Cervin Edin <erik@cervined.in>
Date
Jan 9, 2023, 10:22 UTC
Message-ID
<CA+JQ7M--TeqxH3nj95sAvGTPz9FbHkS2eYfe763w05fUZX0XCA@mail.gmail.com>
In-Reply-To
<PH7PR12MB779560B6C003FEE76E4F2471F1FE9@PH7PR12MB7795.namprd12.prod.outlook.com>
On Mon, Jan 9, 2023 at 3:24 AM fawaz ahmed0 <fawazahmed0@hotmail.com> wrote:
> I have this huge repo: https://github.com/fawazahmed0/currency-api#readme  and I am trying to reduce its size.
>
> I have run filter-repo script on this repo (  https://github.com/fawazahmed0/currency-api/blob/1/.github/workflows/cleanup-repo.yml )

Can you elaborate exactly how you're trying to reduce the repository? Looking at the script it seems you're removing /latest? And/or folders corresponding to certain years?

> The commits were reduced from 1k to 600 , but the space used is still same. (i.e size-pack: 6.47 GiB , https://github.com/fawazahmed95/currency-api/actions/runs/3865919157/jobs/6589710845#step:5:1498 )

The number of commits is actually irrelevant, what matters is really only how much of the tree was pruned. And only if what was pruned wasn't duplicated.

Say you commit
  2018/big.json
  2019/same-identical-big.json
and then delete 2018, the size of the repository in its packed state
will be virtually identical.
You can analyze which files and directories are occupying the most
space by running
  git filter-repo --analyze
and checking the output file. (It's somewhere like
.git/filter-repo/analysis I don't remember exactly)

However, it seems that you're using git in a highly unconventional manner and I'd say it's probably worthwhile to consider if it's even the appropriate tool for the task at hand.

Previous: fawaz ahmed0Next: Elijah Newren
Message 4 of 11 in “Reducing Git Repository size - git-filter-repo doesn't help”
  1. fawaz ahmed0Jan 9, 2023
  2. rsbecker@nexbridge.comJan 9, 2023
  3. fawaz ahmed0Jan 9, 2023
  4. Erik Cervin EdinJan 9, 2023
  5. Elijah NewrenJan 10, 2023
  6. fawaz ahmed0Jan 10, 2023
  7. Elijah NewrenJan 11, 2023
  8. Elijah NewrenJan 11, 2023
  9. fawaz ahmed0Jan 11, 2023
  10. fawaz ahmed0Jan 12, 2023
  11. Elijah NewrenJan 12, 2023

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.