一、简单的设置方法,单一定义文件
右键你想修改属性的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】的【设置】会弹出设置选线卡【常规设置】里的右边右下角位置有个【编辑】按键,点击编辑对全局配置文件进行编辑。
或者Windows XP 在 C:\Documents and Settings\Administrator\Application Data\Subversion\config 文件Windows7 在 C:\Users\Administrator\AppData\Roaming\Subversion\config 文件注意:Administrator为用户名)
查找配置文件中[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 *
PS:
1、修改config文件后,最好重启一下机器,以使设置生效。2、需要将加入的文件先执行add操作,然后再commit,才能生效。若直接执行commit,不会生效。