用戶工具

網站工具


subversion

這是本文件的舊版!


Subversion 版本控制系統

基本操作

  • import
  • checkout
  • update
  • commit
  • branch
  • tag
  • switch
  • merge

Subversion Server + Apache + DAV

#安裝 Subversion
yum subversion
#安裝 Apache
yum install http
#安裝 mod_dav_svn
yum install mod_dav_svn

建立Repository

cd /opt
mkdir svn
mkdir svn/repos
svnadmin create /opt/svn/repos/someproject

設定Apache

chown -R apache.apache /opt/svn
#建立帳號與密碼
htpasswd -cm /opt/svn/passwd admin
htpasswd -m /opt/svn/passwd user1
#編輯 /etc/httpd/conf.d/subversion.conf
<Location /svn>
  DAV svn
  # any "/svn/foo" URL will map to a repository /opt/svn/repos/foo
  SVNParentPath /opt/svn/repos
  # how to authenticate a user
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /opt/svn/svn-auth-file
  # only authenticated users may access the repository
  Require valid-user
  # our access control policy
  AuthzSVNAccessFile /opt/svn/svn-access-file
</Location>

svn-access-file

[groups]
admins = admin
dev1 = user1
[/]
* = r
[repo:/]
@dev1 = rw

新專案

專案目錄規劃架構

  • trunk : Main line of development.
  • tags : Release
  • branches : 分支

要先連線到 svn server 上開版本庫

cd /opt/svn/repos
svnadmin create myproject

然後設定好存取權限 接著到工作環境取出專案

svn checkout http://svn.bestlong.idv.tw/svn/myproject

應該會詢問帳號密碼

subversion.1251277349.txt.gz · 上一次變更: 2010/08/23 15:30 (外部編輯)