Preface
SVN Study Notes
Install SVN
Server Configuration
Create Repository
<dir>
: Directory where the project is stored
1 2
| svnadmin create <dir> cd <dir>
|
- Remove comments on line 19, 20, 27, and 36
conf/svnserve.conf1 2 3 4 5 6
| anon-access = read auth-access = write
password-db = passwd
authz-db = authz
|
- Add account and password under
[users]
conf/passwd1 2
| [users] harry = harryssecret
|
- Add group and account under
[group]
conf/authz1 2
| [groups] harry_and_sally = harry,sally
|
- 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/authz1 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
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
View Help
Finish
References
Bilibili - Heima programmers