"The basic configuration of SVN under the SVN]MAC system
Subversion is already installed by default on MacOS systems and can be used directly by users. This paper mainly introduces some basic problems of SVN on Mac system.
Use the configuration.
Verify that SVN already exists
SVN--version
If SVN is already installed, the current version information is entered:
SVN, version 1.9.4 (r1740329)
Compiled Feb, 18:16:16 on x86_64-apple-darwin15.0.0
......
1. Create an SVN repository
- First step: Create the SVN repository directory
mkdir Repository
CD Repository
mkdir Repo_app
CD Repo_app
Pwd
Output:/users/master/documents/work/repository/repo_app
Description
Repository: This folder is the SVN repository base path, under which multiple repositories can be created
Repo_app: Is the repository we use for app applications, and again, users can create additional repositories
- Step two: Create a repository
Svnadmin Create/users/master/documents/work/repository/repo_app
Once created, a series of configuration files are automatically created in the "Repo_app" directory, as shown in the following structure:
.└── repo_app ├── README.txt ├── conf ├── db ├── format ├── hooks └── locks
2. Configure User Rights 2.1 Modify Master profile: svnserve.conf
File path
/users/master/documents/work/repository/repo_app/conf/svnserve.conf
Modify the following configuration items:
Anon-access = None
auth-access = Write
Password-db = passwd
Authz-db = Authz
注意,修改svnserve.conf时,取消注释后,配置项前面不要有空格。
2.2 Change Password profile: password
File path
/users/master/documents/work/repository/repo_app/conf/password
Add users and passwords under the [Users] configuration item:
[Users]
admin = Admin
2.3 Modifying user group profiles: Authz
Configuration file path:
/users/master/documents/work/repository/repo_app/conf/authz
In the Authz file, add:
[/]admin = rw
Set user admin permissions to have read and write access to all data.
3. Start SVN3.1 Boot
The typical startup command is as follows:
svn-d--listen-port=port--listen-host=host-r/users/master/documents/work/repository
Parameter description:
-D: Indicates that the next process starts SVN
--listen-port: Specifies the listening port for the SVN service, which defaults to 3690
--listen-host: Specify host Name
-r: Specifies the directory where the SVN service listens, exposing the repository under that directory when the service starts
This article uses the following command to start SVN:
Svnserve-d-r/users/master/documents/work/repository/repo_app
As the above command indicates, the SVN service will start as a stand-alone background process, and the SVN service automatically listens to the repository as Repo_app.
As a result, developers can import code or documents into the Repo_app storage warehouse.
3.2 Verifying that the boot was successful
Use the lsof command to view the occupancy of Port 3690:
master$ lsof -i tcp:3690COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEsvnserve 48576 master 3u IPv4 0x6e47ed08d6a3c8df 0t0 TCP *:svn (LISTEN)
As stated above, the Svserve process is already strong on port 3690, indicating that the SVN service starts normally.
4. Initializing the code base
Initialize the warehouse:
svn import /Users/master/Documents/work/workspace/cmm svn://localhost:3690/cmm --username=admin --password=admin -m "Import initial code"
Attention:
一开始,作者比较疑惑的是启动服务后的存储库路径问题。如上所示,通过命令行的 -r 参数指定了顶层目录为 repo_app。则表示,通过该参数限定后,Svn的路径起始位置就是repo_app。因此导入代码时,直接指定代码导入的仓库的相对路径即可:
5. Client Checkout Code
Code move out command:
SVN checkout svn://localhost/cmm./CMM--username=admin--password=admin
6. Client-Submitted code
Add files that are not in version control to SVN's version control:
SVN Add File or folder
Submit Code:
SVN commit-m "Commit your Changeset"
7. Client Update code
The client pulls the latest code from the server side to the local workspace:
SVN update
8. How do I create a multi-warehouse?
In general, developers will build their own SVN server within the corporate LAN for centralized management of the project. The development team typically has multiple projects, based on SVN configuration management, and the recommended strategy is:
Build your own project warehouse for each project
So how do you build multiple warehouses on a single server? This is illustrated by an example.
Suppose you currently need to build two warehouses:
/Users/master/Documents/work/repository 目录结构:.├── auto-di //仓库auto-di│ ├── README.txt│ ├── conf│ ├── db│ ├── format│ ├── hooks│ └── locks└── cmm //仓库cmm ├── README.txt ├── conf ├── db ├── format ├── hooks └── locks
If you need to maintain multiple warehouses, start svn with the "-r" parameter to the public parent directory at most warehouses, as follows:
Svnserve-d-r/users/master/documents/work/repository
The directory for SVN service monitoring is specified as "/users/master/documents/work/repository" with the above command
The access addresses for the two warehouses are:
Svn://localhost/auto-di//relative path Auto-di
SVN://LOCALHOST/CMM//relative path CMM
"The basic configuration of SVN under the SVN]MAC system