如果同步,需要在服务器上,如果是备份,则在安装svn客服端的机器即可。
1.建立新项目1
svnadmin create svn_repos
2.执行(如果windows,需要将pre-revprop-change
改成pre-revprop-change.bat
)1
2
3
4
5cp /var/svndata/svn_repos/hooks/pre-revprop-change.tmpl /var/svndata/svn_repos/hooks/pre-revprop-change
chmod a+x /var/svndata/svn_repos/hooks/pre-revprop-change
svnsync init file:///var/svndata/svn_repos https://showmecode.cn/code/svn_repos --sync-username user_svnsync --sync-password svnsync
svnsync sync --non-interactive file:///var/svndata/svn_repos
FAQ
如果在镜像服务器不小心提交了代码,会导致镜像服务器无法同步。1
2svnsync: E000022: Destination HEAD (15904) is not the last merged revision (1590
3); have you committed to the destination without using svnsync?
解决方法:1
svn propset --revprop -r0 svn:sync-last-merged-rev 15904 file:///D:/csvn/data/repositories/projectname