Question

Whenever I compress my Git repository with 7-Zip, it is many times larger than uncompressed. Specifically, I cloned the HTML5Boilerplate repository, originally 243 KB, and compressed it with 7-Zip, using several methods. With 7z, LZMA compression, highest dictionary size, word size, etc., it becomes over 12 MB when compressed, which is almost 50 times larger! With other methods, such as zip, it is even larger!

The compressed archive consistently passes 7-Zip's "Test Archive" test, when I view the archive with 7zGUI or whatever it's called, they are legible, no corruption or anything, and when I uncompress the archive the files seem to be preserved, including "hidden" files & folders such as .git and .htaccess, and the uncompressed folder is the exact same size as before compressed. This all indicates to me that the issue is not corruption of files, adding random bits to files, or anything like that.

What could possibly cause this to happen?

Was it helpful?

Solution

You've checked something wrong. 243 KB is size of checkout copy not including .git directory. Here is fresh checkout:

$ du --apparent-size -hcs *
1.3K    404.html
8.7K    CHANGELOG.md
5.6K    CONTRIBUTING.md
1.1K    LICENSE.md
2.6K    README.md
1.1K    apple-touch-icon-precomposed.png
416     browserconfig.xml
603     crossdomain.xml
17K     css
49K     doc
766     favicon.ico
206     humans.txt
4.0K    img
1.8K    index.html
118K    js
78      robots.txt
6.7K    tile-wide.png
14K     tile.png
232K    total

$ du --apparent-size -hcs .
13M     .
13M     total

OTHER TIPS

The blobs in the repository are already compressed with zlib so double compression only increases the size

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top