首先当然是下载必要的软件把,我下载的文件如图:
其中,我用到的只有:svn-win32-1.4.3.zip(解压版的svn),TortoiseSVN-1.4.3.8645-win32-svn-1.4.3.msi和LanguagePack-1.4.3.8645-win32-zh_CN.exe 。其中LanguagePack-1.4.3.8645-win32-zh_CN.exe为中文安装包。
安装步骤为:
1. 首先把svn-win32-1.4.3.zip解压到某一目录,我把其解压到:C:\svn-win32-1.4.3 目录下,这样SVN就安装好了。
2. 双击“TortoiseSVN-1.4.3.8645-win32-svn-1.4.3.msi”,安装TortoiseSVN,安装它的原因是,他可以执行可视化操作,不需要用命令行来操作,因为命令行操作会很痛苦的,呵呵。如果你是命令行的老手或热衷于命令行,就不需要这只“小乌龟”软件了。呵呵。
3. 为了没有语言障碍,双击“LanguagePack-1.4.3.8645-win32-zh_CN.exe”,安装汉化包。这样你的TortoiseSVN就是中文了。安装成功后,效果如图:很漂亮吧。
使用如下:
1. 首先要建一个“数据仓库”,随便建立一个目录,我建立 E:\svnRepository 为我的数据仓库根目录,然后又在下面建立一个svnDB01目录和一个svnDB02目录,这个目录可以放置要导入工程的文件,如果要有多个需要管理的工程,可以为每个工程建立一个目录。
2. 建立版本库,在svnDB01中点右键,选择“TortoiseSVN”>> “在此创建版本库(Y)”即可,如图,然后会在此目录下产生 7 个文件。
3. 打开 svnDB01\conf 目录下的svnserve.conf authz passwd 三个文件,如如下修改:
(1)svnserve.conf
### This file controls the configuration of the svnserve daemon, if you ### use it to allow access to this repository. (If you only allow ### access through http: and/or file: URLs, then this file is ### irrelevant.)
### Visit for more information.
[general] ### These options control access to the repository for unauthenticated ### and authenticated users. Valid values are "write", "read", ### and "none". The sample settings below are the defaults. anon-access = none auth-access = write ### The password-db option controls the location of the password ### database file. Unless you specify a path starting with a /, ### the file's location is relative to the conf directory. ### Uncomment the line below to use the default password file. password-db = passwd ### The authz-db option controls the location of the authorization ### rules for path-based access control. Unless you specify a path ### starting with a /, the file's location is relative to the conf ### directory. If you don't specify an authz-db, no path-based access ### control is done. ### Uncomment the line below to use the default authorization file. authz-db = authz ### This option specifies the authentication realm of the repository. ### If two repositories have the same authentication realm, they should ### have the same password database, and vice versa. The default realm ### is repository's uuid. realm = My First Repository |
2. authz
### This file is an example authorization file for svnserve. ### Its format is identical to that of mod_authz_svn authorization ### files. ### As shown below each section defines authorizations for the path and ### (optional) repository specified by the section name. ### The authorizations follow. An authorization line can refer to a ### single user, to a group of users defined in a special [groups] ### section, or to anyone using the '*' wildcard. Each definition can ### grant read ('r') access, read-write ('rw') access, or no access ### ('').
[groups] # harry_and_sally = harry,sally
[/] # harry = rw # * = aa = rw bb = rw
# [repository:/baz/fuz] # @harry_and_sally = rw # * = r |
建了2个用户,aa和bb,其权限都是可以读(r)写(w)的 (关于组的设置以及权限的精确定制,可以看blog中关于svn权限的一篇文章)。需要注意的是这里:
----------------
[/]
# harry = rw
# * =
aa = rw
bb = rw
-----------------
这里有一个[/] ,这里必须为/,好像是设置根目录什么的,具体我没有搞明白(有哪位朋友知道,别忘了给我留言,谢谢),反正我在这费了不少事,总找不到错误原因,原来是 / 的原因,我刚开始写成 /aa 什么的,系统总找不到目录。
3. passwd
### This file is an example password file for svnserve. ### Its format is similar to that of svnserve.conf. As shown in the ### example below it contains one section labelled [users]. ### The name and password for each user follow, one account per line.
[users] # harry = harryssecret # sally = sallyssecret aa = aa bb = bb |
设置aa和bb 2 个用户的密码也是aa 和 bb
基本的设置就这些,具体可以去网上查找些资料。
启动服务:进入C:\svn-win32-1.4.3\bin 目录,执行命令:svnserve -d -r e:/svnrepository/svnDB01 就启动了svnDB01的服务。但是窗口不能关闭,一关闭服务就停止了。如图:
这样就可以用TortoiseSVN进行操作了。
如果想建立子目录,就建立在svnDB01目录下即可(现在svnDB01为根目录)。如果建立了一个名字叫ab的目录,访问方式是svn://localhost/svnDB01/ab 即可。
Subversion乱码解决:
环境变量设置如下:
LANG=zh_CN.UTF8
APR_ICONV_PATH=svn安装目录\iconv
这只是svn的基本知识,更深入的了解,建议多看 的资料
from:http://hi.baidu.com/hivemind/blog/item/7520add666a77f2f06088be1.html