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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.