如何跳过生成 .gitattribute 文件?

How to skip generating .gitattribute file?

我必须不包含 .gitattribute。但是 subgit 将它添加到存储库中。我能知道如何停止 subgit 添加 .gitattribute 文件吗?

作为 SubGit explains in "Line endings handling in SVN, Git and SubGit",需要那些 .gitattributes 文件,特别是如果您在转换后从 Git 存储库推回 SVN。
参见例如“”。

但是对于从 SVN 到 Git 的一次性转换,您可以简单地删除任何 .gitattributes 文件,添加并进行最终提交记录这些删除:

 find . -name .gitattributes -delete

SubGit 在两种情况下添加.gitattributes 文件:当translate.eols is set to 'true' and when translate.otherProperties 设置为'true' 时。后者默认是 'false',所以我相信正在创建 .gitattribiutes 文件,因为 'eols' 是 'true'。为防止创建 .gitattribiutes 文件,应在 SubGit 配置文件中将设置设置为 'false':

[translate]
     eols = false
     otherProperties = false

这里的问题是无法即时更改设置,必须在初始翻译之前设置。因此,如果镜像已经建立,您需要重建它以应用这些设置:

subgit install --rebuild

之后文件应该不会再出现了。