In one of my git projects, I have a zip file which bundles a set of java libraries. The zip file is 4.5MB and contains 11 files. Only one of the contained libraries is changed regularly, the one that I'm working on (which is in the order of 50KB). The other libraries are static.
It would be great if git smartly only changes this small change in the zip file, and not replaces the whole zip file with every commit. Else, my git repository will grow very rapidly.
When I have updated my library and have recreated the zip file, and commit+push the changes, I notice that git writes objects in the order of <100KB to the server, like "Writing objects: 100% (58/58), 77.64 KiB, done.". So it looks like git smartly sends only the changed part of the zip, and not the whole 4.5MB zip file again and again.
Is it indeed the case that git smartly handles zip files?
Git knows how to handle diffs in binary files, so if a few files have changed in the zip it won't store the whole file at each commit.
As a side note, I wouldn't recommend storing zip in your repository, as it's likely to be an artifact (i.e. compilation result) of your code, unless it is a repository storing only your artifacts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With