SVN的安装及配置

一、安装服务器及配置

1、安装服务器

     到官方网站(http://subversion.tigris.org/)下载最新的服务器安装程序,下载下来以后进行安装。安装完成后可以通过在cmd窗口中输入svn help来验证是否安装成功。

2、创建版本库

     运行Subversion服务器需要首先要建立一个版本库(Repository)。版本库可以看作是服务器上集中存放和管理数据的地方。

     (1)使用命令行创建版本库

     svnadmin create D:/svn/repository就会在目录D:/svn/repository下创建一个版本库。如果在命令行中不识别svnserver命令,可以  查看系统环境变量path中有无subversion/bin的条目,没有就手动加上

     (2)使用 TortoiseSVN

      先建立空目录 D:/svn/repository,注意一定是要空的。然后在 Repository 文件夹上“右键->TortoiseSVN->Create Repository here...”,就创建了一系列文件夹和文件。

      注:一个服务器上建一个版本库就可以了,不同的项目可以同时用该版本库。

3、配置服务器

     打开D:/svn/repository/conf/svnserve.conf将以下三个行的注释#去掉

     anon-access=none         //未验证用户无任何权限
     auth-access=write          //已验证用户给予写权限
     password-db=passwd    //密码数据存放到passwd文件中

     然后修改同目录的passwd文件,增加和修改帐号信息。

     注:anon-access=none这条必须显示写出来,否则会有一个默认权限,别人可能不用登陆就能看到你的项目!

4、运行独立服务器

     在dos控制台状态下直接输入svnservice -d -r D:/svn/repository便可以把服务启动。

     也可以将SVN加入控制面->管理工具->服务中,Subversion 从1.4版本开始,可以以windows系统服务的形式在开机时自动运行。但Subversion安装程序还不能把自己安装成windows服务,需要我 们自己进行手动安装,方法如下: 打开一个DOS命令窗口,执行如下命令 sc create svnserve binPath= "/"C:/Program Files/Subversion/bin/svnserve.exe/" --service --root e:/svn" displayname= "Subversion Repository" depend= Tcpip start= auto

      其中,sc是windows自带的服务配置程序,参数binPath表示svnserve可执行文件 的安装路径,由于路径中的"Program Files"带有空格,因此整个路径需要用双引号引起来。而双引号本身是个特殊字符,需要进行转移,因此在路径前后的两个双引号都需要写成/"

      --service参数表示以windows服务的形式运行,--root指明svn repository的位置,service参数与root参数都作为binPath的一部分,因此与svnserve.exe的路径一起被包含在一对双 引号当中,而这对双引号不需要进行转义。

      displayname表示在windows服务列表中显示的名字, depend =Tcpip 表示svnserve服务的运行需要tcpip服务,start=auto表示开机后自动运行。

      安装服务后,svnserve要等下次开机时才会自动运行。

      若要卸载svn服务,则执行 sc delete svnserve 即可

二、安装客户端

      由于编译器种类众多,插件种类也不同,这里只简单介绍下Eclipse的插件安装。我用的版本是 Eclipse3.2.2+MyEclipse_5.1.1,由于本身只有CVS而没有集成SVN,所以要想使用SVN做版本控制只好装一个 Eclipse插件Subclipse,Subclipse的详细安装过程在其官方网站 http://subversion.tigris.org写的很清楚,还带配图,我就直接copy了:

Step 1:

Begin the installation from the Eclipse Help menu item.

Step 2:

This screenshot show the screen as it initially comes up. In this case you will need to change the radio button to indicate that this is a new install.

Step 3:

This screen will vary depending on the features you have installed already. You want to click on the New Remote Site button. If you are behind a proxy and the Eclipse install mechanism does not work, then you can download a zipped version of the update site and then click the New Local Site button instead.

Step 4:

This screen is showing the New Remote Site dialog, filled in with the correct information to install Subclipse

Name: Subclipse 1.2.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.2.x

Name: Subclipse 1.0.x (Eclipse 3.0/3.1)
URL: http://subclipse.tigris.org/update_1.0.x

Step 5:

When you first come back to this screen, the site you added will NOT be selected. Be sure to select it before clicking Next.

Step 6:

This next screen shows all of the features that are available to install.

Step 7:

Click the button to accept the license agreement.

Step 8:

Confirm the install location

Step 9:

There is an Eclipse preference to turn off this next dialog. I have never seen a signed feature. Not even Eclipse.org nor IBM sign their features.

Step 10:

Just a screenshot of the in-process installation.

Step 11:

Eclipse needs to be restarted after installing Subclipse.

Step 12:

Finally, after restarting Eclipse, the first thing you will typically want to do is open the Subclipse Repository perspective where you can define your repositories. Be sure to also check the online help as well as the Subclipse preferences located under Team -> SVN.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值