svn上crlf怎么设置_默认情况下,为文本文件(SVN)设置svn:eol-style = native的最佳方法是什么?...

本文提供了在SVN上为不同类型的文本文件设置svn:eol-style=native的快速方法,包括通过命令行修改和配置文件设置。适用于解决CRLF问题。
摘要由CSDN通过智能技术生成

这应该是一个快速的答案,而不是“深入细节并自己动手,这里是链接”版本。

我们只是去做,好吗?对于颠覆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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值