最近项目原因,架设了一台svn服务器,用于源代码的管理

准备的工具:

1.svn-win32-1.4.3.zip SVN服务器程序

下载地址:

http://subversion.tigris.org/downloads/svn-win32-1.4.3.zip

2.TortoiseSVN  SVN 客户端程序

.步骤

1.svn-win32-1.4.3.zip解压到D:SvnServer


2.D:SvnSeverbin加到系统环境变量(弄计算机的都会吧,不多说了)

3.建立SVN服务,打开cmd, 输入

svnadmin create E:Svn_Project1

4.启动Svn服务,

svnserve -d -r E:Svn_Project1

5.如果需要,将此添加成服务,建议这样做

sc create SVN binpath= “”d:SvnServerbinsvnserve.exe” –service -r E:Svn_Project1″ displayname= “SVN Service” depend= Tcpip start= auto

6.设置服务器

a.设置E:SVN_Projectconfsvnserve.conf文件,去掉#

anon-access = none

password-db = passwd

完整的应该是这样

————————————

### 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 http://subversion.tigris.org/ 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

—————————————

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

# [/foo/bar]
# harry = rw
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r

[groups]
manager = zhai,zhang

[Project1:/]
@manager = rw
zhai=rw
* = r

—————————————-

c.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
zhai= zhai
zhang =zhang

—————————————

7.安装 TortoiseSVN,安装好后得启

8.导入项目文件

      进入要导入的项目文件的目录,右键->TortoiseSVN->import…->


Url of repository 填入本机的地址+要用的项目名
比如本机IP地址为192.168.1.246

svn://192.168.1.246/project1

输入用户名密码即可导入

9.下载源代码:

      在客户机上面运行要导入源码的文件夹中  右键->Svn CheckOut…->


填上svn://192.168.1.246/project1

即可.

大功靠成,有问题留言..希望不会有错误发生.