Skip to content

File Sizes Too Large

As I was compressing my hundreds of photos in my repository, I decided to git push, but then the enumerating of objects failed in the terminal because the total size of the things I am trying to push exceeded 10 MB.

So, I decided to use this command I found on Stack Overflow:

git repack -a -d --depth=250 --window=250

According to ChatGPT, here is what it does:

  • -a: This option tells Git to repack all objects, both loose and packed, into a new pack file. If you omit this option, Git will only repack loose objects that are not already in a pack file.
  • -d: This option tells Git to delete the old pack files after creating the new pack file. This helps to reduce disk space usage, since the old pack files are no longer needed.
  • –depth=250: This option sets the maximum depth of deltas that Git will include in the new pack file. A delta is a compressed representation of the differences between two versions of a file, and Git uses deltas to reduce the size of pack files. By setting the depth to 250, Git will include deltas that go back up to 250 versions of a file. If a delta goes back further than that, Git will include the full version of the file instead of the delta.
  • –window=250: This option sets the size of the sliding window that Git uses when searching for matching data to create deltas. A larger window size can result in better compression, but also requires more memory to perform the operation. By setting the window size to 250, Git will use a 250-byte sliding window.

I noticed that the .git hidden folder is over 300 MB, so I decided to run the command. However, this didn’t solve the problem as the file sizes are still too large.

So, instead, I decided to temporarily remove my week 4 image folder outside of my repo, and run 2 separate git pushes in hopes of splitting the file sizes in half. But, this still didn’t work as the remaining files are still too large.

Solving the Problem

After a long time of haggling and wasting time trying to git push my site, I decided simply re-clone the repository and put all the locally stored files into the new local repository.

I then git pushed my site, and it worked.


Last update: December 27, 2023