git提交后的消息“重写...(90%)”是什么意思? [重复]

时间:2022-05-28 16:56:27

This question already has an answer here:

这个问题在这里已有答案:

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.

当git执行提交时,它会重写二进制文件,类似于重写foobar.bin(76%)。那是什么 %?是旧文件中的百分比更改还是保留百分比。我知道git对文件使用二进制增量,但我只是不知道%代表了多少重写,而且似乎没有在git help commit的帮助页面中。

Thanks!

3 个解决方案

#1


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

它是相似性指数的衡量标准。相似性指数是未改变线的百分比。 git认为你的文件是文本。

#2


I believe Martin is correct, that number is the similarity index. From the git-diff man pages:

我相信马丁是正确的,这个数字是相似指数。从git-diff手册页:

The similarity index is the percentage of unchanged lines, and the dissimilarity index is the percentage of changed lines. It is a rounded down integer, followed by a percent sign. The similarity index value of 100% is thus reserved for two equal files, while 100% dissimilarity means that no line from the old file made it into the new one.

相似性指数是未更改行的百分比,相异性指数是更改行的百分比。它是一个向下舍入的整数,后跟一个百分号。因此,100%的相似性索引值保留用于两个相等的文件,而100%的相异性意味着旧文件中的任何行都不会成为新文件。

First time I saw the number I thought my binaries were changing dramatically!.

我第一次看到这个号码,我以为我的二进制文件发生了巨大变化!

#3


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:

它试图将CR和LF重写为一致的格式。也就是说,它不会将您的二进制文件视为二进制文件。要强制git正确执行此操作,请将以下行放在.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.

所有具有[.bin]扩展名的文件都不会进行回车/换行翻译,也不会进行差异化合并将导致冲突而原始文件保持不变。

#1


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

它是相似性指数的衡量标准。相似性指数是未改变线的百分比。 git认为你的文件是文本。

#2


I believe Martin is correct, that number is the similarity index. From the git-diff man pages:

我相信马丁是正确的,这个数字是相似指数。从git-diff手册页:

The similarity index is the percentage of unchanged lines, and the dissimilarity index is the percentage of changed lines. It is a rounded down integer, followed by a percent sign. The similarity index value of 100% is thus reserved for two equal files, while 100% dissimilarity means that no line from the old file made it into the new one.

相似性指数是未更改行的百分比,相异性指数是更改行的百分比。它是一个向下舍入的整数,后跟一个百分号。因此,100%的相似性索引值保留用于两个相等的文件,而100%的相异性意味着旧文件中的任何行都不会成为新文件。

First time I saw the number I thought my binaries were changing dramatically!.

我第一次看到这个号码,我以为我的二进制文件发生了巨大变化!

#3


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:

它试图将CR和LF重写为一致的格式。也就是说,它不会将您的二进制文件视为二进制文件。要强制git正确执行此操作,请将以下行放在.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.

所有具有[.bin]扩展名的文件都不会进行回车/换行翻译,也不会进行差异化合并将导致冲突而原始文件保持不变。