What does the message "rewrite ... (90%)" after a Git commit mean?

Viewed 27327

When git does a commit it rewrites binary files with something similar to rewrite foobar.bin (76%). What is that %? Is it percent changed or percent retained from the older file. I know that git uses a binary delta for files, but I just don't know how much of a rewrite the % represents and it doesn't seem to be in the help page for git help commit.

Thanks!

3 Answers

Its a measure of the similarity index. The similarity index is the percentage of unchanged lines. git thinks your file is text.

It is attempting to rewrite CRs and LFs into a consistent format. That is, it doesn't see your binary file as binary. To force git to do this properly put the following line in .gitattributes:

*.bin -crlf -diff -merge

From this page that means:

all files with a [.bin] extension will not have carriage return/line feed translations done, won't be diffed and merges will result in conflicts leaving the original file untouched.

Related