SVN应用篇

1、Eclipsesvn插件安装
http://subclipse.tigris.org/update 这个就是svn的更新地址
在eclipse中选择help --> Install new Software 点击上面的Add按钮
name可以随便填写,方便自己识别这是个神马东东,这里我就直接填写svn就可以了
Location输入http://subclipse.tigris.org/update 点击OK(最新汉化版本也可以用这个地址:http://subclipse.tigris.org/update_1.4.x)
等待eclipse连接svn的网站会出现 Subclipse Plugin 和 Subversion Book 全选后点击Finish 等待自动下载安装 然后会提示从启eclipse 点击从启就会发现svn安装完毕了,就这么简单。

安装其他插件也是如此,只要知道更新地址就OK啦。
2、MyEclipse8.5 svn插件安装以及配置
1、从官网下载site-1.6.9.zip文件,网址是:subclipse.tigris.org,
2、从中解压出features与 plugins文件夹,复制到E:\MyEclipse\myPlugin\svn里面,其它的*.xml文件不要。
3、在 E:\MyEclipse\MyEclipse8.5\dropins下新建文件svn.link,内容是:path=E:\\MyEclipse
\\myPlugin\\svn 保存。
4、删除E:\MyEclipse\MyEclipse8.5\configuration \org.eclipse.update文件夹
5、重启myeclipse就一切正常了。[/size]
3、SVN服务器安装以及管理
Window下配置SVN服务器与客户端
如何配置svn服务器:前提条件:
下载最新的svn服务器:
Setup-Subversion-1.5.1.en-us.msi
下载最新的svn客户端:
TortoiseSVN-1.4.5.10425-win32-svn-1.4.5.rar
步骤:

1、安装SVN服务器,到http://subversion.apache.org/packages.html上下载windows版的SVN,并安装,在命令行下运行svn命令,如下所以,则svn服务器安装成功。

Txt代码 复制代码 收藏代码
  1. C:\Documents and Settings\Administrator>svn
  2. 使用“svn help”得到用法。
  C:\Documents and Settings\Administrator>svn 
  使用“svn help”得到用法。

         

2、创建仓库Repository:运行命令

Txt代码 复制代码 收藏代码
  1. C:\Documents and Settings\Administrator>svnadmin create G:\svn
  C:\Documents and Settings\Administrator>svnadmin create G:\svn

 

  该命令会在G盘下自动创建一个名字为svn的文件夹,该文件中的内容如非必要,不要手动修改,其内容是由svn自动维护的,各自得用途:

  conf里文件夹中都是这个仓库的配置文件。

  db是真正用来存储数据版本的地方。

  hooks文件夹中的内容用以定义某些动作触发的hook脚本。

  locks中的文件用于在某些分支或者文件上加锁。   

3、创建用户:进入conf目录(本例中是G:\svn\conf),打开svnserve.conf文件,找到如下内容:

Txt代码 复制代码 收藏代码
  1. [general]
  2. ### These options control access to the repository for unauthenticated
  3. ### and authenticated users. Valid values are "write", "read",
  4. ### and "none". The sample settings below are the defaults.
  5. # anon-access = read
  6. # auth-access = write
  7. ### The password-db option controls the location of the password
  8. ### database file. Unless you specify a path starting with a /,
  9. ### the file's location is relative to the directory containing
  10. ### this configuration file.
  11. ### If SASL is enabled (see below), this file will NOT be used.
  12. ### Uncomment the line below to use the default password file.
  13. # password-db = passwd
[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

Txt代码 复制代码 收藏代码
  1. # anon-access = read
  2. # auth-access = write
# anon-access = read 
# auth-access = write 
Txt代码 复制代码 收藏代码
  1. # password-db = passwd
# password-db = passwd

中的注释去掉修改为

 

Txt代码 复制代码 收藏代码
  1. anon-access = read
  2. auth-access = write
anon-access = read 
auth-access = write 
Txt代码 复制代码 收藏代码
  1. password-db = passwd
password-db = passwd

 

这样就可以使用passwd文件中的用户了。

  打开passwd(和svnserve.conf在同目录下),可以看到,创建好的两个用户都被注释掉了,可以修改者两个用户,也可以新建自己的用户,这里我新创建了一个自己的用户,passwd文件被修改为:

Txt代码 复制代码 收藏代码
  1. [users]
  2. # harry = harryssecret
  3. # sally = sallyssecret
  4. admin=admin
[users]
# harry = harryssecret
# sally = sallyssecret
admin=admin

4、启动SVN服务器,运行命令svnserve -d -r G:\svn,就可以启动服务

Txt代码 复制代码 收藏代码
  1. C:\Documents and Settings\Administrator>svnserve -d -r G:\svn
C:\Documents and Settings\Administrator>svnserve -d -r G:\svn

  -d表示后台运行,-r表示以超级管理员的方式运行,G:\svn是指SVN所管理的仓库。

5、配置SVN服务器开机启动

  打开一个DOS窗口,在任意目录下执行下面的命令:

 

Txt代码 复制代码 收藏代码
  1. //在命令中的每一个等号后面都要有一个空格否则命令执行失败
  2. sc create svnserve binPath= "\"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root d:\svnstore" displayname= "SVN Serve" depend= Tcpip start= auto
//在命令中的每一个等号后面都要有一个空格否则命令执行失败
sc create svnserve binPath= "\"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root d:\svnstore" displayname= "SVN Serve" 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 即可

这样SVN的配置就完成了,到http://tortoisesvn.net/downloads.html下载一个SVN客户端,就可以使用了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值