svn安装及Windows环境SVN迁移到Linux
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了svn安装及Windows环境SVN迁移到Linux相关的知识,希望对你有一定的参考价值。
SVN项目备份
使用svnadmin工具导出到本地。
cd H:Repositories
svnadmin dump H:Repositories est > F:svn_dump est.dump
svnadmin dump H:Repositoriesandroid > F:svn_dumpandroid.dump
svnadmin dump H:RepositoriesBackEnd > F:svn_dumpBackEnd.dump
svnadmin dump H:RepositoriesDevOps> F:svn_dumpDevOps.dump
svnadmin dump H:Repositoriesios > F:svn_dumpios.dump
svnadmin dump H:Repositoriespigcms > F:svn_dumppigcms.dump
svnadmin dump H:RepositoriesProduct > F:svn_dumpProduct.dump
svnadmin dump H:RepositoriesUI > F:svn_dumpUI.dump
svnadmin dump H:Repositorieswechat > F:svn_dumpwechat.dump
svnadmin dump H:RepositoriesWorkLogs > F:svn_dumpWorkLogs.dump
通过ftp工具将如上dump文件上传到centos7,并将用户和组权限文件group.conf 和 htpasswd拷贝上传到centos。
centos 7 SVN安装与配置
1.安装
yum install subversion
版本:svnserve -version
2.创建svn版本库,以test 库项目为例。
mkdir -p /workstation/svn_code/Repositories est
svnadmin create /workstation/svn_code/Repositories est
svnadmin create /workstation/svn_code/Repositoriesandroid
svnadmin create /workstation/svn_code/RepositoriesBackEnd
svnadmin create /workstation/svn_code/Repositoriesios
ls /workstation/svn_code/Repositories est ##生成版本库Repositories文件
3.配置svn信息
cd /workstation/svn_code/Repositories/test/conf
vim authz
在[ group ] 组下添加用户组
admin = admin
在 [project:/] 添加用户组权限
@admin=rw //其中@ 表示对于用户组,* 表示全部用户
vim passwd
[users] 配置用户名和密码
admin = admin123
vim svnserve.conf
取消以下注释:
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz #访问控制文件
realm = project #认证命名空间
vim /root/.subversion/servers
修改为:store-plaintext-passwords = yes
确认安装openssl 与 openssl-devel
yum install openssl openssl-devel
4.svn启动,连接
启用:svnserve -d -r /workstation/svn_code/Repositories
连接:
svn import提交一不在版本控制下的树或文件到版本库。未将版本化的文件导入到版本库。
svn import project svn://IP/project/ -m "admin"
导入备份文件
命令:
svnadmin load /workstation/svn_code/Repositories/test < /home/svn_bak/test.dump
svnadmin load /workstation/svn_code/Repositories/android < /home/svn_bak/android.dump
svnadmin load /workstation/svn_code/Repositories/BackEnd < /home/svn_bak/BackEnd.dump
svnadmin load /workstation/svn_code/Repositories/DevOps < /home/svn_bak/DevOps.dump
svnadmin load /workstation/svn_code/Repositories/ios < /home/svn_bak/ios.dump
svnadmin load /workstation/svn_code/Repositories/pigcms < /home/svn_bak/pigcms.dump
svnadmin load /workstation/svn_code/Repositories/Product < /home/svn_bak/Product.dump
svnadmin load /workstation/svn_code/Repositories/UI < /home/svn_bak/UI.dump
svnadmin load /workstation/svn_code/Repositories/wechat < /home/svn_bak/wechat.dump
svnadmin load /workstation/svn_code/Repositories/WorkLogs < /home/svn_bak/WorkLogs.dump
批量导入,脚本shell
#!/bin/bash
DIR_HOME="/home/svn_bak"
SVN_HOME="/workstation/svn_code/Repositories"
files=`cd $DIR_HOME;ls`
pro="test android BackEnd DevOps ios pigcms Product UI wechat WorkLogs"
for file in $files;
do
#get all *dump files
project=`echo $file | sed -n ‘/.*.dump/p‘ | cut -d ‘.‘ -f1`
if [ "$project"x != ""x ];then
if [ "$project" = "$pro" ];then
continue
fi
create_dir="svn create $SVN_HOME/$project"
svn_load="svnadmin load $SVN_HOME/$project < $DIR_HOME/$project.dump"
execute create_dir order
echo $create_dir
eval $create_dir
execute svn_load order
echo $svn_load
eval $svn_load
fi
done
客户端代码检出测试
Windows客户端 TortoiseSVN checkout。
以上是关于svn安装及Windows环境SVN迁移到Linux的主要内容,如果未能解决你的问题,请参考以下文章