在CentOS安裝SVN

來源:互聯網
上載者:User

標籤:svn

Release: CentOS release 6.7 (Final)

版本: Linux version 2.6.32-573.22.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Mar 23 03:35:39 UTC 2016


SVN:version 1.6.11 (r934486)


Step 1: 安裝Subversion

[[email protected] ~]# yum install subversion


Step 2: 檢查版本

[[email protected] ~]# svn --version


Step 3: 建立SVN目錄和倉庫

[[email protected] svn]# mkdir /opt/svn

[[email protected] svn]# svnadmin create /opt/svn/test.localhost.com


Step 4: 添加使用者和許可權

[[email protected] repos]# vim /opt/svn/test.localhost.com/conf/passwd

[users]

# harry = harryssecret

# sally = sallyssecret

jasonwu = jasonwupw

alanzhang = alanzhangpw

sky = skypw

joel = joelpw


[[email protected] repos]# vim /opt/svn/test.localhost.com/conf/authz 

[groups]

DEV  = joel,sky,alanzhang,jasonwu

[v2.test.localhost.com:/]

@DEV = rw

* =


Step 5: 修改設定檔

[[email protected] repos]# vim /opt/svn/test.localhost.com/conf/svnserve.conf 

anon-access = none

auth-access = write

password-db = /opt/svn/test.localhost.com/conf/passwd

authz-db = /opt/svn/test.localhost.com/conf/authz

realm = My First Repository


Step 6: 開啟svn服務

[[email protected] test.localhost.com]# svnserve -d -r /opt/svn


Step 7: checkout副本

[[email protected] www]# svn co svn://192.168.11.80/test.localhost.com


Authentication realm: <svn://192.168.11.80:3690> My First Repository

Password for ‘joel‘: 

Authentication realm: <svn://192.168.11.80:3690> My First Repository

Username: joel

Password for ‘joel‘: 

Authentication realm: <svn://192.168.11.80:3690> My First Repository

Username: sky

Password for ‘sky‘: 


-----------------------------------------------------------------------

ATTENTION!  Your password for authentication realm:


   <svn://192.168.11.80:3690> My First Repository


can only be stored to disk unencrypted!  You are advised to configure

your system so that Subversion can store passwords encrypted, if

possible.  See the documentation for details.


You can avoid future appearances of this warning by setting the value

of the ‘store-plaintext-passwords‘ option to either ‘yes‘ or ‘no‘ in

‘/root/.subversion/servers‘.

-----------------------------------------------------------------------

Store password unencrypted (yes/no)? 


Step 8: 增加檔案到SVN

[[email protected] test.localhost.com]# vim test.txt

[[email protected] test.localhost.com]# svn add *

A         test.txt


Step 9: 提交檔案到SVN

[[email protected] test.localhost.com]# svn commit * -m ‘test‘

Adding         test.txt

Transmitting file data .

Committed revision 1.


Step 10: 修改鉤子

[[email protected] www]# cd /opt/svn/test.localhost.com/

[[email protected] test.localhost.com]# cd hooks/

[[email protected] hooks]# vim post-commit 

#!/bin/sh

#export LANG=zh_CN.UTF-8


SVN=/usr/bin/svn

WEB=/www/test.localhost.com


#$SVN_PATH update svn://192.168.11.80/test.localhost.com $WEB_PATH  --username joel --password joel --no-auth-cache


$SVN update $WEB  --username sky --password sky


[[email protected] hooks]# chmod -R 755 post-commit


本文出自 “老炮兒” 部落格,請務必保留此出處http://joelemma.blog.51cto.com/11189330/1769817

在CentOS安裝SVN

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.