二进制文件是好的吗? [英] Is git good with binary files?
问题描述
如果git对二进制文件不好,我可以考虑什么工具?
-
您可以使用所谓的二进制比较格式将差异发送至二进制文件。这不是人类可读的,只有在您的存储库中具有精确的 preimage时,才能应用它,例如没有任何模糊。例如:
diff --git a / gitweb / git-favicon.png b / gitweb / git-favicon.png
index de637c0608090162a6ce6b51d5f9bfe512cf8bcf..aae35a70e70351fe6dcb3e905e2e388cf0cb0ac3 100
GIT二进制补丁
delta 85
zcmZ3& SUf?+ pEJNG#Pt9J149GD | NsBH {?u> * {Yr {jv * Y ^ lOtGJcy4sCvGS> LGzvuT
nGSco!%* slUXkjQ0 + { ·· rZKt $ ^ 5c〜Kn)C u6 {1-oD!M s | Fj6
delta 135
zcmXS3!Z <; to + rR3#Pt9J149GDe = s< (trzjI0MY3OYE5upapO?DR {I1pyyR7cx(jY7y ^ {FfMCvb5IaiQM`NJfeQjFwttKJyJNq @
hveI = @ x = fAo = hV3 $ -MIWu9% vGSr> mdKI; RB2CICA_GnfDX
-
您可以使用 textconv gitattribute 拥有
git diff
show human-readable diff二进制文件或二进制文件的一部分。例如,对于* .jpg文件,它可以在EXIF信息中有所不同,对于PDF文件,它可以在它们的文本表示(pdf2text或类似的东西)之间有所不同。
HTH。
Is git good with binary files?
If I have a lot of uncompressed files being modified, and many compressed files never (or almost never) modified, would git handle it well? For example, if I insert or remove the middle and insert data near the end it will notice it as it does with text?
If git isn't good with binary files, what tool might I consider?
In addition to other answers.
You can send a diff to binary file using so called binary diff format. It is not human-readable, and it can only be applied if you have exact preimage in your repository, i.e. without any fuzz.
An example:diff --git a/gitweb/git-favicon.png b/gitweb/git-favicon.png index de637c0608090162a6ce6b51d5f9bfe512cf8bcf..aae35a70e70351fe6dcb3e905e2e388cf0cb0ac3 100 GIT binary patch delta 85 zcmZ3&SUf?+pEJNG#Pt9J149GD|NsBH{?u>)*{Yr{jv*Y^lOtGJcy4sCvGS>LGzvuT nGSco!%*slUXkjQ0+{(x>@rZKt$^5c~Kn)C@u6{1-oD!M<s|Fj6 delta 135 zcmXS3!Z<;to+rR3#Pt9J149GDe=s<ftM(tr<t*@sEM{Qf76xHPhFNnYfP!|OE{-7; zjI0MY3OYE5upapO?DR{I1pyyR7cx(jY7y^{FfMCvb5IaiQM`NJfeQjFwttKJyJNq@ hveI=@x=fAo=hV3$-MIWu9%vGSr>mdKI;RB2CICA_GnfDX
You can use textconv gitattribute to have
git diff
show human-readable diff for binary files, or parts of binary files. For example for *.jpg files it can be difference in EXIF information, for PDF files it can be difference between their text representation (pdf2text or something like that).
HTH.
这篇关于二进制文件是好的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!