一、下载安装文件

可执行文件:http://subversion.tigris.org/files/documents/15/44049/Setup-Subversion-1.5.3.msi

二、软件安装

可执行文件安装方法:当然是双击直接运行Setup-Subversion-1.5.3.msi咯。简单吧!

三、SVN服务端环境配置

创建资源库:方法一>>在命令行输入svnadmincreateE:\svn_repository,建立工程,svn自动会在该目录下建立若干文件。

资源库配置修改:进入目录"E:\svn_repository"

首先打开文件密码文件"passwd"添加

George.yin=a8.com

再打开权限文件"authz":

###Thisfileisanexampleauthorizationfileforsvnserve.

###Itsformatisidenticaltothatofmod_authz_svnauthorization

###files.

###Asshownbeloweachsectiondefinesauthorizationsforthepathand

###(optional)repositoryspecifiedbythesectionname.

###Theauthorizationsfollow.Anauthorizationlinecanreferto:

###-asingleuser,

###-agroupofusersdefinedinaspecial[groups]section,

###-analiasdefinedinaspecial[aliases]section,

###-allauthenticatedusers,usingthe'$authenticated'token,

###-onlyanonymoususers,usingthe'$anonymous'token,

###-anyone,usingthe'*'wildcard.

###

###Amatchcanbeinvertedbyprefixingtherulewith'~'.Rulescan

###grantread('r')access,read-write('rw')access,ornoaccess

###('').

[aliases]

#joe=/C=XZ/ST=Dessert/L=SnakeCity/O=SnakeOil,Ltd./OU=ResearchInstitute/CN=JoeAverage

[groups]

#harry_and_sally=harry,sally

#harry_sally_and_joe=harry,sally,&joe

admin=george.yin

#[/foo/bar]

#harry=rw

#&joe=r

#*=

#[repository:/baz/fuz]

#@harry_and_sally=rw

#*=r

[/]

@admin=rw

*=r

最后打开服务配置文件"svnserve.conf"添加

###Thisfilecontrolstheconfigurationofthesvnservedaemon,ifyou

###useittoallowaccesstothisrepository.(Ifyouonlyallow

###accessthroughhttp:and/orfile:URLs,thenthisfileis

###irrelevant.)

###Visithttp://subversion.tigris.org/formoreinformation.

[general]

###Theseoptionscontrolaccesstotherepositoryforunauthenticated

###andauthenticatedusers.Validvaluesare"write","read",

###and"none".Thesamplesettingsbelowarethedefaults.

anon-access=read

auth-access=write

###Thepassword-dboptioncontrolsthelocationofthepassword

###databasefile.Unlessyouspecifyapathstartingwitha/,

###thefile'slocationisrelativetothedirectorycontaining

###thisconfigurationfile.

###IfSASLisenabled(seebelow),thisfilewillNOTbeused.

###Uncommentthelinebelowtousethedefaultpasswordfile.

password-db=passwd

###Theauthz-dboptioncontrolsthelocationoftheauthorization

###rulesforpath-basedaccesscontrol.Unlessyouspecifyapath

###startingwitha/,thefile'slocationisrelativetothethe

###directorycontainingthisfile.Ifyoudon'tspecifyan

###authz-db,nopath-basedaccesscontrolisdone.

###Uncommentthelinebelowtousethedefaultauthorizationfile.

authz-db=authz

###Thisoptionspecifiestheauthenticationrealmoftherepository.

###Iftworepositorieshavethesameauthenticationrealm,theyshould

###havethesamepassworddatabase,andviceversa.Thedefaultrealm

###isrepository'suuid.

#realm=MyFirstRepository

[sasl]

###ThisoptionspecifieswhetheryouwanttousetheCyrusSASL

###libraryforauthentication.Defaultisfalse.

###ThissectionwillbeignoredifsvnserveisnotbuiltwithCyrus

###SASLsupport;tocheck,run'svnserve--version'andlookforaline

###reading'CyrusSASLauthenticationisavailable.'

#use-sasl=true

###Theseoptionsspecifythedesiredstrengthofthesecuritylayer

###thatyouwantSASLtoprovide.0meansnoencryption,1means

###integrity-checkingonly,valueslargerthan1arecorrelated

###totheeffectivekeylengthforencryption(e.g.128means128-bit

###encryption).Thevaluesbelowarethedefaults.

#min-encryption=0

#max-encryption=256

启动服务:在命令行输入:svnserve-d或者指定参数启动svnserve-d-re:\svn

四、SVN在Eclipse中的配置

在空白处右击---新建---资源库位置,在URL选项中写入:svn://localhost/),确定即可在弹出的对话框中输入用户名和密码(为之前在文件修改的用户名和密码),确定(在这一步如果出错请参见五、可能遇到的问题1和2

右击建立的资源库位置,新建一个远程文件夹,填入文件夹名,Next—Finish

右击新建的远程文件夹,选导入选项,选择导入目标文件的目录,点击确定即可

打开file菜单---New---Others….---SVN---从SVN中出去项目---next---选定资源库位置---Next---选择目标远程文件夹---Next---为项目命名---Finish

五、可能遇到的问题Svn中文网

遇到eclipse重启的问题解决方法:设置我的电脑》高级》环境变量中的APR_ICONV_PATH指向svn-win32-1.5.5.zipzip包解压后的iconv文件夹。

eclipse中SVNRepository视图中添加资源时会出现错误如:svn:Norepositoryfoundin'svn://localhost/svn/demo'这时需要重新启动SVN服务改用这样的命令svnserve-d-re:\svn\demo启动时指定具体的路径,另外这样也行svnserve-d-re:\svn这时只指定了一个路径添加eclipse中添加时则用'svn://localhost/demo'就行了。

安装成服务:

sccreatesvnbinpath="E:\dev\install\subversion\bin\svnserve.exe--service-rE:\svn_repository"displayname="svnservice"depend=tcpipstart=auto

说明:

svn:这个名字是实质的服务名,displayname是现实名

E:\dev\install\subversion\bin\svnserve.exe为安装目录下的bin\svnserve.exe

--service:注意是两个--,写成-service是会出错的

E:\svn_repository:在安装时(svnadmincreateE:\svn_repository)的目录

Displayname:服务显示名