【英文】SVN学习笔记

Preface

SVN Study Notes

Install SVN

1
brew install subversion

Server Configuration

Create Repository

<dir>: Directory where the project is stored

1
2
svnadmin create <dir>
cd <dir>

Configure Repository

  • Remove comments on line 19, 20, 27, and 36
conf/svnserve.conf
1
2
3
4
5
6
anon-access = read
auth-access = write

password-db = passwd

authz-db = authz

Configure Account and Password

  • Add account and password under [users]
conf/passwd
1
2
[users]
harry = harryssecret

Configure Group

  • Add group and account under [group]
conf/authz
1
2
[groups]
harry_and_sally = harry,sally

Configure Permissions

  • Set read and write permissions after group configuration

/: Root directory of the project

r: Read permission
w: Write permission

*: All users
harry: User
@harry_and_sally: Group

conf/authz
1
2
3
4
[/]
* = rw
harry = rw
@harry_and_sally = rw

Start Server

-d: Run in the background
-r: Supervise directory

<dir>: Directory where the project is stored

1
svnserve -d -r <dir>

Basic Commands

Initialize

  • Import the project from local to the server for the first time

<code>: Local directory of the project
<svn>: SVN address (e.g., svn://127.0.0.1)
<text>: Comment

1
svn import <code> checkout <svn> "<text>"

Checkout

  • Initialize and update the project to the local directory

<dir>: Directory to store the project

1
svn checkout <svn> <dir>

Update Remote Code

  • Synchronize the updated code from the local to the remote server
1
2
cd <dir>
svn commit -m "Comment"

Update Local Code

  • Synchronize the updated code from the remote server to the local
1
svn update

View Help

1
svn help

Finish

References

Bilibili - Heima programmers