【教程】如何利用sourceforge Google Code的SVN显示Html页面

2012/03/03 01:49
阅读数 437

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

演示地址googlecode:http://cmp4.googlecode.com/svn/trunk/doc/index.htm

演示地址sourceforge:https://xoxx.svn.sourceforge.net/svnroot/xoxx/doc/index.htm

下面开始说一下方法(适用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/

展开阅读全文
打赏
0
0 收藏
分享
加载中
答复哈博主

引用来自“庄与邻”的评论

不过,codegoogle ,不是有专门的WIKI吗?

wiki能解决的话也不至于要直接访问html了
2012/03/03 15:04
回复
举报
不过,codegoogle ,不是有专门的WIKI吗?
2012/03/03 13:33
回复
举报
更多评论
打赏
2 评论
0 收藏
0
分享
返回顶部
顶部