Centos SVN 搭建

  • 安装

yum install -y subversion

  • 配置

mkdir /data/svn/project

svnadmin create /data/svn/project

vim /data/svn/project/conf/svnserve.conf

[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
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with 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 access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
realm = /data/svn/scripts

vim /data/svn/project/conf/passwd

[users]
user = password

vim /data/svn/project/conf/authz

[/]
user = rw
  • 启动

svnserve -d -r /data/svn/project --listen-port 3690

  • 停止

kill

  • 使用

svn list svn://192.168.1.1/project --username=user --password=password

svn mkdir svn://192.168.1.1/project/test --username=user --password=password

svn import test svn://192.168.1.1/project/test -m "add first project" --username=user --password=password

svn delete test svn://192.168.1.1/project/test -m "delete first project" --username=user --password=password

svn checkout(co) svn://192.168.1.1/project/test --username=user --password=password

svn status

svn add * (--non-recursive) (不递归)

svn add *.sh

svn add dir --depth empty(只添加目录不添加下面的文件)

svn delete *

svn commit(ci) -m "commit"

svn update(up) (* --accept 'mine-conflict')(本地为准)

svn resolve * --accept 'mine-conflict'(本地为准)

svn mv svn://192.168.1.1/project/test1 svn://192.168.1.1/project/test2

  • 备份

svnadmin dump /data/svn/project > 20190101.dump

  • 还原

svnadmin load /data/svn/project < /data/20180524.dump

 

  • 服务迁移后改仓库

svn info

svn switch --relocate svn://192.168.1.1/project/test1 svn://192.168.1.1/project/test2 

 

 

参考文献:

https://www.cnblogs.com/vijayfly/p/5711962.html

http://www.linuxidc.com/Linux/2016-01/127679.htm

http://blog.csdn.net/dandanzmc/article/details/51936136

https://blog.csdn.net/hellboy0621/article/details/80432490

https://blog.csdn.net/bjnihao/article/details/53023252

posted @ 2017-12-13 21:17  jhc888007  阅读(193)  评论(0编辑  收藏  举报