---
title: "windows下SVN及其Eclipse插件的安装"
author: "sailqi"
date: "2012-04-07T21:58:00Z"
tags: ["Eclipse", "SVN"]
categories: ["研发管理"]
slug: "windows-svn-eclipse"
draft: false
lastmod: "2012-08-20T14:09:58Z"
id: 1638220
url: "https://sailqi.iteye.com/blog/1638220"
---

## **一、服务端**

1\. 下载Subversion，安装。

2\. 在dos窗口，进入安装目录的bin目录，添加系统服务（这样就不用每次都去打开启动窗口），其中E:\\SVN为svn库地址，可以自定义：

```
sc create svnservice binpath= "D:\Program Files\Subversion\bin\svnserve.exe --service -r E:\SVN" displayname= "SVNService" depend= Tcpip start= auto
```

3\. 配置：以上操作将在E盘生成一个svn文件夹，进入E:\\svn\\conf，有三个文件：authz、passwd、svnserve.conf

1)authz是用户权限配置文件

```
[/]
tan=rw
*=r
[/delphi]
ygw=rw
nmc=rw
*=r
```

\[/]代表下面的用户名可以操作该版本库下的所有项目，\[/delphi]代表下面的用户只可对delphi项目进行读写操作，就以上图解释：tan用户可以对该版本库的所有项目进行读写，而其他用户只能是读，不能进行写的操作，ygw和nmc用户只可以对版本库里的DELPHI项目进行读写，其他用户对这个项目都只能是读而不能写，TAN用户也不可以对DELPHI项目进行写操作，因为在最后面用了\*=R，切断了父权限，而\*=R不能省去，省去会出错，如果设\*= ，则是不能读该项目，就是打开版本库的时候看不到该项目下的文件。  
注意：这里的#号是注释的意思。

2)passwd是用户名密码配置文件  
passwd文件最终设置完成的样式如下图：

```
[users]
Tan= 123
ygw= 123
nmc= 123
```

设置用户名和密码。左边是用户名，右边是该用户名的密码。

3)svnserve.conf是SVN服务文件  
snserve.conf最终设置格式如下图：

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

anon-access = none 表示不允许匿名访问，然后把原文件的这四项的#号去掉就可以了。

## 二、客户端

下载TortoiseSVN，安装。

## 三、Eclipse插件

1\. 在线安装：Help—&gt;Install New Software—&gt;Add，在Localtion一项输入SVN插件地址[http://subclipse.tigris.org/update\_1.8.x](http://subclipse.tigris.org/update_1.8.x)，确定，选中搜索到的插件进行安装。

2\. 或者到[http://subclipse.tigris.org](http://subclipse.tigris.org)下载zip包，并按以上方式，类似进行安装。

3\. 同步地址：svn://localhost/svn

参考资料：  
[http://blog.163.com/yuxiangtong0524@126/blog/static/8008616320103234142644/](http://blog.163.com/yuxiangtong0524@126/blog/static/8008616320103234142644/)  
[http://qiufengstudio.bokee.com/viewdiary.177645880.html](http://qiufengstudio.bokee.com/viewdiary.177645880.html)