svn上crlf怎么设置_【教程】如何利用sourceforge Google Code的SVN显示Html页面

本文介绍了如何使用TortoiseSVN为不同类型的文件设置属性,特别是针对HTML、图片和文本文件的mime-type设置,以便在sourceforge和Google Code上正确显示。教程包括了通过右键菜单为单个文件设置属性以及修改全局配置文件实现自动标记的方法。
摘要由CSDN通过智能技术生成

无意中在网上看到了这个帖子试验了一下,果然好用,不只适用与googlecode还适用于sourceforge.net,兲語真的感觉网络这东西真的太好了,但是希望你们可以善用他不要滥用他。

下面开始说一下方法(适用TortoiseSVN):

一、简单的设置方法,单一定义文件

右键你想修改属性的html文件,然后选【TortoiseSVN】→【Properties (中文一般为【属性】)】然后就会看到Properties 界面,然后点击【新建(快捷键N)】选择【高级(快捷键A)】然后弹出高级选项卡,选择属性【svn:mime-type】,然后添加值为text/html,然后确定重新同步下就可以了,

同理

*.htm* = svn:mime-type=text/html

*.png = svn:mime-type=image/png

*.jpg = svn:mime-type=image/jpeg

*.gif = svn:mime-type=image/gif

*.css = svn:mime-type=text/css

*.js = svn:mime-type=text/javascript

*.xml = svn:mime-type=text/xml

二、设置TortoiseSVN通用配置文件,然后再次上传后就自动标记文件属性了。

点右键进入【TortoiseSVN】的【设置】会弹出设置选线卡【常规设置】里的右边右下角位置有个【编辑】按键,点击编辑对全局配置文件进行编辑。

查找配置文件中[miscellany]在下面加入

[miscellany]

global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .cvsignore Thumbs.db CVS

use-commit-times = yes

enable-auto-props = yes

查找配置文件中[auto-props]在下面加入

### Section for configuring automatic properties.

[auto-props]

### 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 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.

##################################################

### Binary files

##################################################

*.bmp = svn:mime-type=image/bmp

*.gif = svn:mime-type=image/gif

*.gz = svn:mime-type=application/x-gzip

*.ico = svn:mime-type=image/x-icon

*.jar = svn:mime-type=application/zip

*.jpg = svn:mime-type=image/jpeg

*.pdf = svn:mime-type=application/pdf

*.png = svn:mime-type=image/png

*.ps = svn:mime-type=application/postscript

*.tif = svn:mime-type=image/tiff

*.vsd = svn:mime-type=application/octet-stream

*.zip = svn:mime-type=application/zip

##################################################

### Text files, OS dependent eol-style

##################################################

*.dsp = svn:eol-style=CRLF

*.dsw = svn:eol-style=CRLF

*.mm = svn:eol-style=LF;svn:mime-type=text/xml

*.sh = svn:eol-style=LF;svn:executable

Makefile = svn:eol-style=LF

##################################################

### Text files, eol-style is native

##################################################

*.c = svn:eol-style=native;svn:mime-type=text/plain

*.cpp = svn:eol-style=native;svn:mime-type=text/plain

*.css = svn:eol-style=native;svn:mime-type=text/css

*.diff = svn:eol-style=native;svn:mime-type=text/plain

*.dsl = svn:eol-style=native;svn:mime-type=text/sgml

*.dtd = svn:eol-style=native;svn:mime-type=text/plain

*.ent = svn:eol-style=native;svn:mime-type=text/plain

*.gml = svn:eol-style=native;svn:mime-type=text/sgml

*.h = svn:eol-style=native;svn:mime-type=text/plain

*.htm = svn:eol-style=native;svn:mime-type=text/html

*.html = svn:eol-style=native;svn:mime-type=text/html

*.java = svn:eol-style=native;svn:mime-type=text/plain

*.js = svn:eol-style=native;svn:mime-type=text/plain

*.mod = svn:eol-style=native;svn:mime-type=text/plain

*.patch = svn:eol-style=native;svn:mime-type=text/plain

*.php = svn:eol-style=native

*.pl = svn:eol-style=native

*.py = svn:eol-style=native

*.sgm = svn:eol-style=native;svn:mime-type=text/sgml

*.sgml = svn:eol-style=native;svn:mime-type=text/sgml

*.svg = svn:eol-style=native;svn:mime-type=text/xml

*.txt = svn:mime-type=text/plain

*.xml = svn:eol-style=native;svn:mime-type=text/xml

*.xsl = svn:eol-style=native;svn:mime-type=text/xml

*.xslt = svn:eol-style=native;svn:mime-type=text/xml

README = svn:eol-style=native

文件添加后,在提交之前,可以通过如下命令查看新增文件的属性:

$ svn proplist -v *

注意:

1、修改config文件后,最好重启一下机器,以使设置生效。

2、需要将加入的文件先执行add操作,然后再commit,才能生效。若直接执行commit,不会生效。

除非注明,兲語天空文章均为原创,转载请以链接形式标明本文标题和地址

本文标题:【教程】如何利用sourceforge Google Code的SVN显示Html页面

本文地址:http://cycy.sourceforge.net/2012/01/sourceforge-google-code-svn-html/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值