Windows下Subversion和TortoiseSVN构建SVN版本控制

1.下载Subversionwindow安装版本svn-1.4.6-setup.exe

http://subversion.tigris.org/

http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100

2.下载TortoiseSVNTortoiseSVN-1.5.2.13595-win32-svn-1.5.1.msi版本

http://tortoisesvn.net/

http://tortoisesvn.net/downloads

3.安装subversion

双击svn-1.4.6-setup.exe,一路next完成安装。

设置环境变量,将subversionbin设置到path中。如:D:Program FilesSubversionbin

4.安装TortoiseSVN

双击TortoiseSVN-1.5.2.13595-win32-svn-1.5.1.msi,一路next完成安装。

5.创建svn容器Repository

在硬盘上任意位置创建一文件夹,如D:svnRepository,在文件夹上右键

TortoiseSVN->Create repository here

创建成功后将在D:svnRepository下生成一系列文件。

6.配置容器的访问权限

在容器的目录下D:svnRepositoryconf中,用记事本打开svnserve.conf文件,找到

# anon-access = read

# auth-access = write

# 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 = read

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 directory containing

### this configuration file.

### If SASL is enabled (see below), this file will NOT be used.

### 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 the

### directory containing this file. 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

[sasl]

### This option specifies whether you want to use the Cyrus SASL

### library for authentication. Default is false.

### This section will be ignored if svnserve is not built with Cyrus

### SASL support; to check, run 'svnserve --version' and look for a line

### reading 'Cyrus SASL authentication is available.'

# use-sasl = true

### These options specify the desired strength of the security layer

### that you want SASL to provide. 0 means no encryption, 1 means

### integrity-checking only, values larger than 1 are correlated

### to the effective key length for encryption (e.g. 128 means 128-bit

### encryption). The values below are the defaults.

# min-encryption = 0

# max-encryption = 256

配置访问用户列表,用户名加密码

记事本打开该目录下的文件passwd

去掉

# harry = harryssecret

# sally = sallyssecret

的注释#,同意注意每行要顶格,开头也不能有空格。

说明harry = harryssecret表示:用户名=密码

当然也可以自己增加,如gary=gary

最好效果如下:

### 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

gary=gary

7.启动Subversion

因为之前设置了环境变量path= D:Program FilesSubversionbin;因此打开cmd,直接运行命令:svnserve -d -r D:svnRepository

这样Subversion服务器就假设好了。注意:这个dos 窗口不能关,一关subversion 服务就关了

启动subversion的服务可以通过两种方式来完成

1.第一种手动输入cmd命令,svn服务端软件服务的启动可以通过cmd命令来启动,定位到subversion的安装目录,我的机器是C:\Program Files\Subversion\bin, 输入命令 svnserve –d –r D:\svndemo,其中D:\svndemo是svn数据仓库的目录。

2.第二种把subversion的服务添加到windows服务,作为开机自动启动的服务,同样可以通过cmd命令来完成,命令如下  sc create svn binpath= "\"D:\Program Files\Subversion\bin\svnserve.exe\" --service -r D:\svndemo" displayname= "Subversion Server" depend= Tcpip start= auto,其中"binpath="后面跟的是subversion的安装目录,--service -r后面的参数是数据仓库的路径。通过这种方式就把subversion的服务作为windows自启动的服务了。

接下只要重启服务器就可以了,服务器端的subversion的服务就可以开始运行了.

启动服务:

net start Subversion Server

 

停止服务:

net stop Subversion Server

 

卸载服务:

sc delete Subversion Server


8.向容器添加需版本控制的文件(也可以远程,只需urlip就行)

在硬盘上任意位置,右键需要上传的文件的上级文件夹,TortoiseSVN->Import…

此处为了测试,创建文件夹D:importFiles,里面放一doc文件test.doc,即要将test.doc上传到svn中去。右键importFilesTortoiseSVN->Import…,输入容器的url

svn://localhost/svnRepository

输入用户名和密码:

就将test.doc文件上传到svn容器了

9.从容器获得test.doc文件(也可以远程,只需urlip就行)

在任意位置,某文件上右键D:checkOutFiles,点击SVN Checkout…

输入url即可

10.完成

这样就完成的部署和存取,修改相应的文件,提交即可,注意始终保持Subversion的运行。

注意,在第8步中会报错“期望文件系统格式“2”;发现格式“3””

原因是TortoisSVN的版本过高,或与Subversion不匹配。

应该换成低版本的TortoisSVN TortoiseSVN-1.4.8.12137-win32-svn-1.4.6.msi

即应该为svn-1.4.6-setup.exeTortoiseSVN-1.4.8.12137-win32-svn-1.4.6.msi的组合才行,步骤和之前的一样,只是在第6步中的svnserve.conf文件中没有后面的内容

[sasl]

### This option specifies whether you want to use the Cyrus SASL

### library for authentication. Default is false.

### This section will be ignored if svnserve is not built with Cyrus

### SASL support; to check, run 'svnserve --version' and look for a line

### reading 'Cyrus SASL authentication is available.'

# use-sasl = true

### These options specify the desired strength of the security layer

### that you want SASL to provide. 0 means no encryption, 1 means

### integrity-checking only, values larger than 1 are correlated

### to the effective key length for encryption (e.g. 128 means 128-bit

### encryption). The values below are the defaults.

# min-encryption = 0

# max-encryption = 256

====================================================================================================================

以上SVN服务器版本和TortoiseSVN客户端版本应匹配,最新版本1.6.1。TortoiseSVN是windows下的external版本控制工具,VS非express editon可以用开源插件Ankhsvn  (http://ankhsvn.tigris.org/)或收费的Visual SVN来集成。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值