我已经阅读了Git 文档,该文档表明我可以明确地将某些文件设置为文本,因此它们的行尾会自动更改或作为二进制文件以确保它们不受影响。
但是,我也读到 Git 非常擅长检测二进制文件,这让我觉得这不是必需的。所以我的问题是我真的需要为我的存储库中的每个文件扩展名指定这些显式设置吗?我已经看到一些建议对所有图像文件扩展名都这样做。
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary