一、为什么使用SVN
二、安装软件
Setup-Subversion-1.7.5 Svn服务器
TortoiseSVN-1.7.7.22907-win32-svn-1.7.5 svn客户端(图形化界面)
svn-1.8.5插件 MyEclipse svn插件
三、搭建svn服务器
1、安装Subversion
2、选择svn资源库存放路径,我这里选择的是D:\upload\svnRep
3、打开命令提示符执行svnadmin create svnrepTest命令。则会在当前目录下创建了一个svnrepo目录,里面包含了一些db,conf等子目录。
4、在安装目录conf下有一个svnserve.conf文件,在里面有一行password-db = passwd表示如果访问库的用户名都配置在passwd文件里面。在前面把#去掉。并且需要把[general]前的#去掉,passwd文件中需要把[users]前的#去掉。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
xhay = xhay123456
5、权限配置
authz文件是默认指定存放用户权限的文件,[groups]代表分组,这里我们设置dev、admin、testUser三个组,将前面创建的xhay用户分到dev组里,同样只需在[groups]下写上devr=xhay即可,[/]代 表根目录,比如设置[repository: /chenlly/fuz] 如果我们要设置dev组有完全的访问权限就在下面加上@dev=rw,前面加@符代表组,除此之外我们允许所有人都有 读取权限还要在下面加上*=r
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
admin = xhay
dev = xionghai
testUser = test1
[/]
@admin = rw
@dev = rw
@testUser = r
# [/foo/bar]
# harry = rw
# &joe = r
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
四、启动svn服务
执行 svnserve –d –r D:\upload\svnRep\svnrepTest
注意:svn服务器运行方式有两种
a、svnserve
b、Apache http
这时候如果要想svn正常运行必须保持上面这个命令窗口一直开着,所以一般情况下我们是把svn服务加入到windows服务中。
添加服务:sc create SVN binpath= "/"D:/upload/svnTool/bin/svnserve.exe/" --service -r D:\upload\svnRep\svnrepTest" displayname= "SVN Service" depend= Tcpip start= auto
删除服务:sc delete SVN
五、在MyEclipse中使用svn
1、把svn插件放到myeclipse安装目录的dropins下。重启MyEclipse
2、在MyEclipse===》Window===》Prefenerces===》Team===》SVN 能够查看到svn插件
3、添加资源库位置
4、在MyEclipse===》Window===》Show View===》Other在弹出窗口的搜索框输入svn 选择SVN资源库
在svn资源库中新建一个资源库位置:svn://localhost 点完成,输入用户名xhay密码xhay123456保存,就可以正常使用svn了。