Windows下Subversion和TortoiseSVN構建SVN版本控制

xuniji123發表於2008-08-13

WindowsSubversionTortoiseSVN構建SVN版本控制

2008-8-13 楊普

1.下載Subversionwindow安裝版本svn-1.4.6-setup.exe

servlets/ProjectDocumentList?folderID=8100

2.下載TortoiseSVNTortoiseSVN-1.5.2.13595-win32-svn-1.5.1.msi版本

3.安裝subversion

雙擊svn-1.4.6-setup.exe,一路next完成安裝。

設定環境變數,將subversionbin設定到path中。如:D:Program FilesSubversionbin

4.安裝TortoiseSVN

雙擊TortoiseSVN-1.5.2.13595-win32-svn-1.5.1.msi,一路next完成安裝。

5.建立svn容器Repository

在硬碟上任意位置建立一資料夾,如D:svnRepository,在資料夾上右鍵

TortoiseSVN->Create repository here

建立成功後將在D:svnRepository下生成一系列檔案。

6.配置容器的訪問許可權

在容器的目錄下D:svnRepositoryconf中,用記事本開啟svnserve.conf檔案,找到

# anon-access = read

# auth-access = write

# password-db = passwd

並去掉註釋#

注意,去掉註釋後,不要留下空格,保持每行頂格,切記!!!

效果如下:

### This file controls the configuration of the svnserve daemon, if you

### use it to allow access to this repository. (If you only allow

### access through http: and/or file: URLs, then this file is

### irrelevant.)

### Visit for more information.

[general]

### These options control access to the repository for unauthenticated

### and authenticated users. Valid values are "write", "read",

### and "none". The sample settings below are the defaults.

anon-access = read

auth-access = write

### The password-db option controls the location of the password

### database file. Unless you specify a path starting with a /,

### the file's location is relative to the directory containing

### this configuration file.

### If SASL is enabled (see below), this file will NOT be used.

### Uncomment the line below to use the default password file.

password-db = passwd

### The authz-db option controls the location of the authorization

### rules for path-based access control. Unless you specify a path

### starting with a /, the file's location is relative to the the

### directory containing this file. If you don't specify an

### authz-db, no path-based access control is done.

### Uncomment the line below to use the default authorization file.

# authz-db = authz

### This option specifies the authentication realm of the repository.

### If two repositories have the same authentication realm, they should

### have the same password database, and vice versa. The default realm

### is repository's uuid.

# realm = My First Repository

[sasl]

### This option specifies whether you want to use the Cyrus SASL

### library for authentication. Default is false.

### This section will be ignored if svnserve is not built with Cyrus

### SASL support; to check, run 'svnserve --version' and look for a line

### reading 'Cyrus SASL authentication is available.'

# use-sasl = true

### These options specify the desired strength of the security layer

### that you want SASL to provide. 0 means no encryption, 1 means

### integrity-checking only, values larger than 1 are correlated

### to the effective key length for encryption (e.g. 128 means 128-bit

### encryption). The values below are the defaults.

# min-encryption = 0

# max-encryption = 256

配置訪問使用者列表,使用者名稱加密碼

記事本開啟該目錄下的檔案passwd

去掉

# harry = harryssecret

# sally = sallyssecret

的註釋#,同意注意每行要頂格,開頭也不能有空格。

說明harry = harryssecret表示:使用者名稱=密碼

當然也可以自己增加,如gary=gary

最好效果如下:

### This file is an example password file for svnserve.

### Its format is similar to that of svnserve.conf. As shown in the

### example below it contains one section labelled [users].

### The name and password for each user follow, one account per line.

[users]

harry=harryssecret

sally=sallyssecret

gary=gary

7.啟動Subversion

因為之前設定了環境變數path= D:Program FilesSubversionbin;因此開啟cmd,直接執行命令:svnserve -d -r D:svnRepository

這樣Subversion伺服器就假設好了。

8.向容器新增需版本控制的檔案(也可以遠端,只需urlip就行)

在硬碟上任意位置,右鍵需要上傳的檔案的上級資料夾,TortoiseSVN->Import…

此處為了測試,建立資料夾D:importFiles,裡面放一doc檔案test.doc,即要將test.doc上傳到svn中去。右鍵importFilesTortoiseSVN->Import…,輸入容器的url

svn://localhost/svnRepository

輸入使用者名稱和密碼:

就將test.doc檔案上傳到svn容器了

9.從容器獲得test.doc檔案(也可以遠端,只需urlip就行)

在任意位置,某檔案上右鍵D:checkOutFiles,點選SVN Checkout…

輸入url即可

10.完成

這樣就完成的部署和存取,修改相應的檔案,提交即可,注意始終保持Subversion的執行。

注意,在第8步中會報錯“期望檔案系統格式“2”;發現格式“3””

原因是TortoisSVN的版本過高,或與Subversion不匹配。

應該換成低版本的TortoisSVN TortoiseSVN-1.4.8.12137-win32-svn-1.4.6.msi

即應該為svn-1.4.6-setup.exeTortoiseSVN-1.4.8.12137-win32-svn-1.4.6.msi的組合才行,步驟和之前的一樣,只是在第6步中的svnserve.conf檔案中沒有後面的內容

[sasl]

### This option specifies whether you want to use the Cyrus SASL

### library for authentication. Default is false.

### This section will be ignored if svnserve is not built with Cyrus

### SASL support; to check, run 'svnserve --version' and look for a line

### reading 'Cyrus SASL authentication is available.'

# use-sasl = true

### These options specify the desired strength of the security layer

### that you want SASL to provide. 0 means no encryption, 1 means

### integrity-checking only, values larger than 1 are correlated

### to the effective key length for encryption (e.g. 128 means 128-bit

### encryption). The values below are the defaults.

# min-encryption = 0

# max-encryption = 256

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8271432/viewspace-1008906/,如需轉載,請註明出處,否則將追究法律責任。

相關文章