Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Git differentially store GZip files?

Tags:

git

gzip

Does Git store text compressed with Gzip as binary files or can it tell that it's text and store the changes between updates to the files?

like image 799
James McMahon Avatar asked Jun 29 '12 00:06

James McMahon


1 Answers

Git does not attempt to look into any binary files. In fact, it doesn't even attempt to look into text files. It doesn't store updates at all. What it does is store the full contents of every single file, but it does delta-compression across the entire object store. So the data that's stored on-disk is in fact just updates (hence "delta-compression"), but Git itself sees full files.

That said, no, Git does not attempt to decompress gzipped-compressed files in order to re-compress itself. What this means is text that's compressed with gzip will have about the same performance as any other compressed format (e.g. images), which is to say, there won't be much savings.

like image 77
Lily Ballard Avatar answered Oct 24 '22 04:10

Lily Ballard