这应该是一个快速的答案,而不是“深入细节并自己动手,这里是链接”版本。
我们只是去做,好吗?对于颠覆1.8+:
$ cd my_checkout_dir
$ svn propset svn:auto-props '
### src
*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
*.pch = svn:eol-style=native
*.lua = svn:eol-style=native
*.py = svn:eol-style=native
*.pl = svn:eol-style=native
*.txt = svn:eol-style=native
*.sh = svn:eol-style=native;svn:executable
### ui
*.xib = svn:eol-style=native
*.ui = svn:eol-style=native
*.qrc = svn:eol-style=native
### project
*.pro = svn:eol-style=native
*.pbxproj = svn:eol-style=native
*.json = svn:eol-style=native
*.xcworkspacedata = svn:eol-style=native
*.plist = svn:eol-style=native
' .
$ svn commit -m 'Got really tired of svn:eol-style issues'请注意在结尾处关闭单引号和点(即当前目录)。根据您的需要调整此列表,将svn propset svn:auto-props '…' .复制到unix / msys sh-terminal(是的,使用Enters)。提交后,my_checkout_dir下面的所有文件将在添加时继承相应的属性。在此操作之前添加的文件将不会被修改。正如您在*.sh及以下所示,您可以通过;添加更多属性。如果要更改列表,只需重复所有内容即可。
以下是我的~/.subversion/config中svn建议的默认值,供参考:
### The format of the entries is:
### file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?'). All entries which match (case-insensitively) will be
### applied to the file. Note that auto-props functionality
### must be enabled, which is typically done by setting the
### 'enable-auto-props' option.
# *.c = svn:eol-style=native
# *.cpp = svn:eol-style=native
# *.h = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
# *.dsp = svn:eol-style=CRLF
# *.dsw = svn:eol-style=CRLF
# *.sh = svn:eol-style=native;svn:executable
# *.txt = svn:eol-style=native;svn:keywords=Author Date Id Rev URL;
# *.png = svn:mime-type=image/png
# *.jpg = svn:mime-type=image/jpeg
# Makefile = svn:eol-style=native