CentOS系统安装使用版本控制系统Subversion的办法

家电修理 2023-07-16 19:17www.caominkang.com电器维修

  subversion是一个版本控制系统,能够将文件放在中心版本库中,那么在CentOS系统中要如何使用subversion呢?下面我就给大家介绍下CentOS安装使用subversion的方法。

  1.安装Subversion

  yum install subversion

  2.创建版本库

  a.mkdir -p /var/svn/repositories(创建版本库目录)

  b.cd /var/svn/repositories

  c.svnadmin create rock-eng(创建版本库rock-eng)

  3.启动svn

  svnserve -d -r /var/svn/repositories

  4.配置访问权限

  a.cd /var/svn/repositories/rock-eng/conf/

  b.vim svnserve.conf

  ### This file controls the configuration of the svnserve daemon, if you

  ### use it to allo aess to this repository. (If you only allo

  ### aess through http and/or file URLs, then this file is

  ### irrelevant.)

  ### Visit http://subversion.tigris./ for more information.

  [general]

  ### These options control aess to the repository for unauthenticated

  ### and authenticated users. Valid values are “rite”, “read”,

  ### and “none”。 The sample settings belo are the defaults.

  anon-aess = none

  auth-aess = rite

  ### The passord-db option controls the location of the passord

  ### database file. Unless you specify a path starting ith a /,

  ### the file‘s location is relative to the directory containing

  ### this configuration file.

  ### If SASL is enabled (see belo), this file ill NOT be used.

  ### Unment the line belo to use the default passord file.

  passord-db = passd

  ### The authz-db option controls the location of the authorization

  ### rules for path-based aess control. Unless you specify a path

  ### starting ith 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 aess control is done.

  ### Unment the line belo to use the default authorization file.

  authz-db = authz

  ### This option specifies the authentication realm of the repository.

  ### If to repositories have the same authentication realm, they should

  ### have the same passord database, and vice versa. The default realm

  ### is repository’s uuid.

  # realm = My First Repository

上一页123下一页共3页

  [sasl]

  ### This option specifies hether you ant to use the Cyrus SASL

  ### library for authentication. Default is false.

  ### This section ill be ignored if svnserve is not built ith 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 ant 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 belo are the defaults.

  # min-encryption = 0

  # max-encryption = 256

  vim passd

  ### This file is an example passord file for svnserve.

  ### Its format is similar to that of svnserve.conf. As shon in the

  ### example belo it contains one section labelled [users]。

  ### The name and passord for each user follo, one aount per line.

  [users]

  # harry = harryssecret

  # sally = sallyssecret

  rockeng = 123456

上一页123下一页共3页

  vim authz

  ### This file is an example authorization file for svnserve.

  ### Its format is identical to that of mod_authz_svn authorization

  ### files.

  ### As shon belo each section defines authorizations for the path and

  ### (optional) repository specified by the section name.

  ### The authorizations follo. An authorization line can refer to

  ### - a single user,

  ### - a group of users defined in a special [groups] section,

  ### - an alias defined in a special [aliases] section,

  ### - all authenticated users, using the ‘$authenticated’ token,

  ### - only anonymous users, using the ‘$anonymous’ token,

  ### - anyone, using the ‘’ ildcard.

  ###

  ### A match can be inverted by prefixing the rule ith ‘~’。 Rules can

  ### grant read (‘r’) aess, read-rite (‘r’) aess, or no aess

  ### (‘’)。

  [aliases]

  # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Averag

  e

  [groups]

  # harry_and_sally = harry,sally

  # harry_sally_and_joe = harry,sally,&joe

  [/]

  # harry = r

  # &joe = r

  # =

  rockeng = r

  # [repository:/baz/fuz]

  # @harry_and_sally = r

  # = r

  5.重启svn

  killall svnserve

  svnserve -d -r /var/svn/repositories

  6.检出svn co svn://127.0.0.1/rock-eng

  7.添加文件svn add 目录

  8.提交修改svn mit

  9.删除文件但保存本地副本svn delete --keep-local 目录

  10.忽略当前目录下的data和attachment目录

  a.svn propedit svn:ignore 。

  b.在编辑器中输入目录名,用回车分隔

  c.svn mit

  11.查看当前目录的状态svn status

  问题1

  svn 无法使用外部编辑器获得日志信息;考虑设置环境变量 $SVN_EDITOR,或者使用 --message (-m) 或 --file (-F) 选项

  svn 没有设置 SVN_EDITOR,VISUAL 或 EDITOR 环境变量,运行时的配置参数中也没有 “editor-cmd” 选项

  解决方法

  a.vim ~/.bash_profile

  b.增加export SVN_EDITOR=vim

  上面就是CentOS安装使用subversion的方法介绍了,包括了版本库的创建和subversion的配置,电脑维修网希望对你有所帮助。

Copyright © 2016-2025 www.caominkang.com 曹敏电脑维修网 版权所有 Power by