One. Installation
Yum Install Subversion
Two. Configuration
This system adopts the strategy of building a repository for each project separately. Configuration files, password files, access control files, etc. are all placed in the Conf directory of the repository.
So each time you start a new project, you must create a new repository and reconfigure each configuration file. There is also a very important one, requiring the members to reconfigure the client, including server repository path, local path and other information.
1. Create a repository directory (you can create multiple, and the following items will need to be reconfigured after you create a new library.) Note the difference between the installation directory and the repository directory, the following is the Repository directory)
Mkdir–p/home/svn/repos
#类似可以创建 MKDIR–P/HOME/SVN/REPOS2/HOME/SVN/REPOS3
2. Create the SVN repository (corresponding to the above directory)
Svnadmin Create/home/svn/repos
After executing this command, SVN automatically adds the necessary configuration files under the Repos directory.
Note: The repository differs from the normal folder, the new file cannot be identified by SVN directly on the operating system, and the file must be imported into the repository using commands such as import.
This is the SVN internal directive, create for the new repository. Please use SVN help to see the detailed instructions.
3. Modifying a repository configuration file
Vi/home/svn/repos/conf/svnserve.conf
Each parameter function is described in the comments in the configuration file, which is configured as follows:
[General]
Anon-access = none # makes non-authorized users inaccessible
auth-access = Write # Enables authorized users to have write permissions
Password-db = passwd # indicates password file path
authz-db = authz # access Control file
Realm =/home/svn/repos # authentication namespace, Subversion is displayed in the authentication prompt and as a keyword for credential caching.
The other uses the default configuration. Each statement must be shelf write, the left can not leave a blank, otherwise there will be an error.
4. Configure the user
vi/home/svn/repos/conf/passwd
Enter the following:
[Users]
username1 = Password1
UserName2 = Password2
You can add multiple, this is the user name password pair.
5. Configure permissions
Vi/home/svn/repos/conf/authz
This configuration file sets the authorization for each user.
Includes read-only R, read-write RW. If no users are listed, access is not allowed. You can also group users, please refer to the SVN manual, the following is a simple example:
#对仓库repos根目录权限设置
[repos:/]
User1 = RW
User2 = R
6. import files using Import
The new repository is empty and needs to be imported into the working directory.
This statement will import the files found under path/home/user/code into the Subversion repository you created.
SVN import/home/code/file:///home/svn/repos/-M "comment"
Three. Start the service
Svnserve-d-r/home/svn/
SVN checkout Svn://ip/repos
Enter the user name password to
[from:]http://www.linuxidc.com/linux/2012-02/53109.htm
Subversion under Linux [reprint]