subversion是一个版本控制系统,能够将文件放在中心版本库中,那么在CentOS系统中要如何使用subversion呢?下面小编就给大家介绍下CentOS安装使用subversion的方法。
1.安装Subversion
yuminstallsubversion
2.创建版本库
a.mkdir-p/var/svn/repositories(创建版本库目录)
b.cd/var/svn/repositories
c.svnadmincreaterock-eng(创建版本库rock-eng)
3.启动svn
svnserve-d-r/var/svn/repositories
4.配置访问权限
a.cd/var/svn/repositories/rock-eng/conf/
b.vimsvnserve.conf
###Thisfilecontrolstheconfigurationofthesvnservedaemon,ifyou
###useittoallowaccesstothisrepository.(Ifyouonlyallow
###accessthroughhttp:and/orfile:URLs,thenthisfileis
###irrelevant.)
###Visithttp://subversion.tigris.org/formoreinformation.
[general]
###Theseoptionscontrolaccesstotherepositoryforunauthenticated
###andauthenticatedusers.Validvaluesarewrite,read,
###andnone。Thesamplesettingsbelowarethedefaults.
anon-access=none
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
上一页123下一页共3页 [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
vimpasswd
###Thisfileisanexamplepasswordfileforsvnserve.
###Itsformatissimilartothatofsvnserve.conf.Asshowninthe
###examplebelowitcontainsonesectionlabelled[users]。
###Thenameandpasswordforeachuserfollow,oneaccountperline.
[users]
#harry=harryssecret
#sally=sallyssecret
rockeng=123456
上一页123下一页共3页 vimauthz
###Thisfileisanexampleauthorizationfileforsvnserve.
###Itsformatisidentic altothatofmod_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=JoeAverag
e
[groups]
#harry_and_sally=harry,sally
#harry_sally_and_joe=harry,sally,&joe
[/]
#harry=rw
#&joe=r
#*=
rockeng=rw
#[repository:/baz/fuz]
#@harry_and_sally=rw
#*=r
5.重启svn
killallsvnserve
svnserve-d-r/var/svn/repositories
6.检出:svncosvn://127.0.0.1/rock-eng
7.添加文件:svnadd目录
8.提交修改:svncommit
9.删除文件但保存本地副本:svndelete--keep-local目录
10.忽略当前目录下的data和attachment目录
a.svnpropeditsvn:ignore。
b.在编辑器中输入目录名,用回车分隔
c.svncommit
11.查看当前目录的状态:svnstatus
问题1:
svn:无法使用外部编辑器获得日志信息;考虑设置环境变量$SVN_EDITOR,或者使用--message(-m)或--file(-F)选项
svn:没有设置SVN_EDITOR,VISUAL或EDITOR环境变量,运行时的配置参数中也没有editor-cmd选项
解决办法:
a.vim~/.bash_profile
b.增加:exportSVN_EDITOR=vim
上面就是CentOS安装使用subversion的方法介绍了,包括了版本库的创建和subversion的配置,希望对你有所帮助。