创建版本库
[[email protected] /]# svnadmin create /application/svndata/sadoc
[[email protected] /]# tree /application/
/application/
├── svndata
│ └── sadoc
│ ├── conf
│ │ ├── authz
│ │ ├── passwd
│ │ └── svnserve.conf
│ ├── db
│ │ ├── current
│ │ ├── format
│ │ ├── fsfs.conf
│ │ ├── fs-type
│ │ ├── min-unpacked-rev
│ │ ├── rep-cache.db
│ │ ├── revprops
│ │ │ └── 0
│ │ │ └── 0
│ │ ├── revs
│ │ │ └── 0
│ │ │ └── 0
│ │ ├── transactions
│ │ ├── txn-current
│ │ ├── txn-current-lock
│ │ ├── txn-protorevs
│ │ ├── uuid
│ │ └── write-lock
│ ├── format
│ ├── hooks
│ │ ├── post-commit.tmpl
│ │ ├── post-lock.tmpl
│ │ ├── post-revprop-change.tmpl
│ │ ├── post-unlock.tmpl
│ │ ├── pre-commit.tmpl
│ │ ├── pre-lock.tmpl
│ │ ├── pre-revprop-change.tmpl
│ │ ├── pre-unlock.tmpl
│ │ └── start-commit.tmpl
│ ├── locks
│ │ ├── db.lock
│ │ └── db-logs.lock
│ └── README.txt
└── svnpasswd
备份
[[email protected] conf]# cp svnserve.conf svnserve.conf.default
修改svn服务配置文件
[general]
12 anon-access = none
13 auth-access = none
20 password-db = /application/svnpasswd/passwd
27 authz-db = /application/svnpasswd/authz
之所以把认证和密码文件放到/application/svnpasswd/里,是为了统一认证,当然也可以每个版本库独立的认证和密码
cd /application/svndata/sadoc/conf/
cp authz passwd /application/svnpasswd/
安全无小事
chmod 700 /application/svnpasswd/*
添加用户
[[email protected] svnpasswd]# cat passwd
[users]
Da = Da123
Yo = Yo123
添加组,设置用户、组权限
sagroup = Da,Yo
[sadoc:/]
Da = rw
Yo = r
@sagroup = r
把sadoc版本库checkout下来
svn co svn://192.168.0.220/sadoc/ /svndata/ --username=Da --password=Da123
svn update svn://192.168.0.220/sadoc/ /svndata/ --username=Da --password=Da123
出现乱码时
LC_CTYPE="en_US.UTF-8"
LC_ALL=
查看svn服务器文件
[[email protected] svndata]# svn ls svn://192.168.0.220/sadoc/ /svndata/ --username=Da --password=Da123 -v
上传文件 ---上传文件时要在checkout那个目录下上传,不然可能不行
[[email protected] svn]# touch {a..h}
[[email protected] svn]# svn add {a..h}
[[email protected] svn]# svn ci -m "svn ci data" 必须得要输入点啥
简单配置大概就是这些了,接下来是常用的钩子(Hooks)