参考:http://www.ha97.com/4467.html
1.
# current directory: /home/lizk
mkdir svn
cd svn
svnadmin create myapp
svn import /home/lizk/project file:///home/lizk/svn/myapp -m "init directory"
2.
# current directory: /home/lizk/svn/myapp/conf
# edit file-passwd
[users]
# harry = harryssecret
# sally = sallyssecret
pm = hello
#edit authz
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
[/]
pm = rw
* =
general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
启动:
svnserve -d -r /home/lizk/svn
关闭:
ps -aux|grep svnserve
kill -9 ID号
4. check out
svn co svn://192.168.60.10/myapp
5. 开机启动
参考:http://blog.csdn.net/linglongwunv/article/details/5186968
vim /etc/rc.d/rc.local
/usr/bin/svnserve -d -r /home/lizk/svn
注:
svn list svn://192.168.60.10/myapp // 列举目录
svn export svn://192.168.60.10/myapp,用于导出干净的项目文件,即不包括.svn文件信息。
svn mkdir svn://192.168.60.10/a/b/c -m "" // 创建目录
svn remove svn://192.168.60.10/a/b/trunk -m "sss" // 删除目录
svn mkdir svn://192.168.60.10/a/b/c/branches -m "" // 创建目录
svn import v1.0/ svn://192.168.60.10/a/b/c/trunk -m "init trunk" // 导入项目文件
svn checkout svn://192.168.60.10/a/b/c/trunk ./myproject // 导出
svn cp svn://192.168.60.10/a/b/c/trunk svn://192.168.60.10/a/b/c/branches/v1.0 -m "init v1.0 branch" // 创建branch
svn info // 查看当前目录的svn信息
svn sw --relocate
svn switch --relocate svn://[email protected]/a/b/c/branches/v1.8.9 svn://[email protected]/a/b/c/branches/v1.8.9 // 修改svn服务器ip,或者部署到别的机器后,重定位。
(注意:path,其实可以不打,不打默认表示当前目录)
把当前目录即import,又作为export目录方法:(http://stackoverflow.com/questions/678437/svn-in-place-import-and-checkout)
cd /home/user/mydirname
svn co svn://192.168.1.111 . # this only creates the ".svn" folder for version control
svn add ./* # tell svn you want to version control all files in this dir
svn ci