{"id":220,"title":"linux\u4e0bsvn\u73af\u5883\u642d\u5efa","good":0,"bad":0,"hit":2174,"created_at":"2016-04-21 00:45:40","content":"

\u73af\u5883\uff1acentos6.7<\/p>

<\/p>

\u76ee\u6807\uff1a\u5728win7\u4e0b\u8fde\u63a5centos6.7\u4e0a\u7684svn<\/p>

svn\u4ed3\u5e93\u8def\u5f84\uff1a\/svn\/2016<\/p>

\u5728win7\u63d0\u4ea4\u5230centos6.7\u65f6\uff0c\u63d0\u4ea4\u7684\u6587\u4ef6\u4f1a\u540c\u6b65\u66f4\u65b0\u5230\u7ad9\u70b9test.hu-rong.com\u4e0b<\/p>

<\/p>

<\/p>

1\u3001linux\u4e0bsvn\u642d\u5efa<\/p>

\u7528root\u7528\u6237\u767b\u5f55\uff0c<\/p>

yum install subversion<\/p>

mkdir \/svn<\/p>

svnadmin create \/svn\/2016<\/p>

cd \/svn\/2016<\/p>

<\/p>

2\u3001\u4fee\u6539\u914d\u7f6e<\/p>

\u5148\u8fdb\u5165\u76ee\u5f55\u4e0b<\/p>

[root@iZ62vgzgugyZ conf]# cd \/svn\/2016\/conf[root@iZ62vgzgugyZ conf]# lsauthz  passwd  svnserve.conf[root@iZ62vgzgugyZ conf]#<\/p>

<\/p>

\u4fee\u6539 svnserve.conf,\u6ce8\u610f\uff0c\u8fd9\u51e0\u4e2a\u53c2\u6570\u524d\u9762\u4e0d\u80fd\u6709\u7a7a\u683c\uff0c\u5426\u5219\u8fde\u63a5\u4e0d\u4e0a<\/strong><\/p>

anon-access = none  \/\/\u8fd9\u91cc\u8981\u8bbe\u4e3anone\uff0c\u5426\u5219\u5728\u7248\u672c\u6bd4\u8f83\u65f6\u4f1a\u62a5\u9519\uff1aSVN Error: Unreadable path encountered; access denied;<\/p>

auth-access = writepassword-db = passwdauthz-db = authz<\/p>

<\/p>

\u4fee\u6539passwd<\/p>

\u52a0\u4e00\u4e2a\u7528\u6237\uff0c\u524d\u9762\u662f\u7528\u6237\u540d\u540e\u9762\u662f\u5bc6\u7801[users]hurong = hurong<\/p>

<\/p>

\u4fee\u6539authz<\/p>

\u7ed9hurong\u7528\u6237\u589e\u52a0\u8bfb\u5199\u6743\u9650\uff0c\u6743\u9650\u8303\u56f4\u4e3a\/,\u5373\u6240\u6709\u4ed3\u5e93\u90fd\u6709rw\u6743\u9650[\/]hurong=rw<\/p>

<\/p>

\u8fd9\u4e9b\u8bbe\u7f6e\u597d\u4e86\u4ee5\u4e3a\u53ef\u4ee5\u6b63\u5e38\u8fde\u63a5\uff0c\u6d4b\u8bd5\u4e00\u76f4\u8fde\u63a5\u4e0d\u4e0a\uff0c\u641e\u4e86\u4e24\u5929\uff0c\u6709\u51e0\u70b9\u95ee\u9898\uff0c\u4e00\u822c\u641e\u5b9a\u5c31\u53ef\u4ee5\u8fde\u63a5\u4e0a\u4e86\uff1a<\/p>

1\u3001\u5982\u679c\u4e4b\u524d\u8fde\u63a5\u8fc7\u5176\u5b83svn\uff0c\u4e14\u4fdd\u5b58\u4e86\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\u7a7a\u767d\u5904\u70b9\u51fb\u53f3\u952e\uff0c\u9009\u4e4c\u9f9f\u56fe\u6807->setting->save data \u628aclear\u90fd\u70b9\u4e00\u4e0b<\/p>

2\u3001\u4fee\u6539\u4e86\u914d\u7f6e\u4e00\u5b9a\u8981\u8bb0\u5f97\u91cd\u65b0\u542f\u52a8svn,\u6211\u5c31\u662f\u8fd9\u91cc\u6ca1\u91cd\u542f\uff0c\u641e\u4e86\u4e24\u5929\u90fd\u6ca1\u8fde\u63a5\u4e0a\uff0c\u91cd\u542f\u547d\u4ee4\uff1a<\/strong><\/p>

\u5148\u6740\u4e00\u4e0b\uff1akillall svnserve    \/\/\u505c\u6b62 <\/strong><\/p>

svnserve -d -r \/svn\/2016\/  \/\/ \u542f\u52a8  <\/strong><\/p>

\u68c0\u6d4bSVN \u7aef\u53e3    netstat -ln |grep 3690 <\/strong><\/p>

3\u3001\u5982\u679c\u8fd8\u4e0d\u884c\uff0c\u68c0\u67e5\u4e00\u4e0bcentos\u9632\u706b\u5899\u662f\u5426\u5141\u8bb83690\u7aef\u53e3<\/p>

<\/p>

<\/p>

\u8bbe\u7f6e\u540c\u6b65\uff1a<\/p>

\u5148\u5728win7\u4e0b\u5728\u67d0\u4e2a\u9879\u76ee\u4e2d\u8fde\u63a5\u4e0a\u521a\u8bbe\u7f6e\u7684svn(\u767b\u5f55\u65f6\u8f93\u4e0a\u9762\u8bbe\u7f6e\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801)\u5e76\u4e0a\u4f20\u9879\u76ee\u4ee3\u7801<\/p>

\u592a\u665a\u4e86,\u56f0\uff0c\u770b\u89c6\u9891\u5427\uff0c\u4e0d\u5199\u4e86\uff01<\/p>

http:\/\/www.tudou.com\/programs\/view\/P12fQywmxSs\/<\/a> <\/p>

<\/p>

\u8865\u4e0a\u5982\u4f55\u8bbe\u7f6e\u540c\u6b65\uff1a<\/p>

\u5047\u8bbe\u8981\u5c06svn\u7684\u4ee3\u7801\u540c\u6b65\u5230\/www\/wwwroot\/test.hu-rong.com\u4e0b\uff0c\u8fd9\u7ad9\u70b9\u5bf9\u5e94\u7684\u57df\u540d\u5c31\u662ftest.hu-rong.com[root@iZ62vgzgugyZ test.hu-rong.com]# pwd\/www\/wwwroot\/test.hu-rong.com[root@iZ62vgzgugyZ test.hu-rong.com]#\u786e\u4fdd\u8be5\u76ee\u5f55\u4e0b\u4e3a\u7a7a\uff0c\u7136\u540e\u5148\u68c0\u51fa\u4e00\u4efd\uff0c\u5373checkout:[root@iZ62vgzgugyZ test.hu-rong.com]# svn checkout file:\/\/\/svn\/2016 \/www\/wwwroot\/test.hu-rong.com\/\u68c0\u51fa\u5b8c\u6210\u540e\uff0c\u53d1\u73b0\u76ee\u5f55\u4e0b\u591a\u4e86\u5f88\u591a\u6587\u4ef6\uff0c\u5219\u8868\u793acheckout\u6210\u529f\uff0c\u5f53\u524d\u6240\u6709\u6587\u4ef6\u7248\u672c\u4e3a1\uff1b(\u8fd8\u662f0\u4e0d\u8bb0\u5f97\u4e86); <\/p>

\u7136\u540e\u8bbe\u7f6e\u540c\u6b65\uff1a<\/p>

\u8fdb\u5165svn\u4ed3\u5e93\u4e0b\u7684hooks\u4e0b[root@iZ62vgzgugyZ 2016]# cd \/svn\/2016\/hooks\/\u5c06post-commit.tmpl\u590d\u5236\u4e00\u4efd[root@iZ62vgzgugyZ hooks]# cp .\/post-commit.tmpl .\/post-commit\u7f16\u8f91\u5b83<\/p>

[root@iZ62vgzgugyZ hooks]# vi post-commit\u7136\u540e\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u8bbe\u7f6e\uff1aexport LANG=zh-CN.UTF-8SVN=\/usr\/bin\/svn  \/\/\u76f8\u5f53\u4e8ewindows\u4e0b\u7684c:programWEB=\/www\/wwwroot\/test.hu-rong.com$SVN up $WEB\u9000\u51fa\u7f16\u8f91\uff0c\u4fdd\u5b58<\/p>

\u7ed9\u6743\u9650\uff1a[root@iZ62vgzgugyZ hooks]# chmod 755 .\/post-commit[root@iZ62vgzgugyZ hooks]# ls -ltotal 40-rwxr-xr-x 1 root root 2063 Apr 29 09:28 post-commit-rw-r--r-- 1 root root 1977 Apr 20 00:22 post-commit.tmpl-rw-r--r-- 1 root root 1638 Apr 20 00:22 post-lock.tmpl-rw-r--r-- 1 root root 2289 Apr 20 00:22 post-revprop-change.tmpl-rw-r--r-- 1 root root 1567 Apr 20 00:22 post-unlock.tmpl-rw-r--r-- 1 root root 3426 Apr 20 00:22 pre-commit.tmpl-rw-r--r-- 1 root root 2410 Apr 20 00:22 pre-lock.tmpl-rw-r--r-- 1 root root 2786 Apr 20 00:22 pre-revprop-change.tmpl-rw-r--r-- 1 root root 2100 Apr 20 00:22 pre-unlock.tmpl-rw-r--r-- 1 root root 2780 Apr 20 00:22 start-commit.tmpl[root@iZ62vgzgugyZ hooks]#<\/p>

<\/p>

\u4ee5\u4e0a\u8bbe\u7f6e\u6b63\u786e\u540e\uff0c\u53ef\u4ee5\u540c\u6b65\uff0c\u4f46\u662f\u5982\u679c\u6587\u4ef6\u540d\u4e2d\u6709\u4e2d\u6587\uff0ccommit\u65f6\u4f1a\u62a5\u9519\uff1b\u5176\u5b83\u6587\u4ef6\u4f1a\u540c\u6b65\u6210\u529f\uff1b<\/p>"}