Linux installation and configuration version control software subversion (svn little turtle) practical tutorial

Linux installation and configuration of the repository subversion actual combat tutorial
 1. Install
  yum install subversion
  2. Configuration
  This system adopts the strategy of building a separate repository for each project. Configuration files, password files, and access control files are all placed in the conf directory of the repository.
  So every time you start a new project, you must create a new version library and reconfigure the configuration files. There is also a very important one, requiring each team member to reconfigure the client, including the server version library path, local path and other information.
  1. Create a version library directory (multiple libraries can be created, and the following items need to be reconfigured after creating a new library. Note the difference between the installation directory and the version library directory, the following are all version library directories)
  mkdir –p /home/svn/repos
  #Similar to create mkdir -p /home/svn/repos /home/svn/repos1
  2. Establish svn repository (corresponding to the above directory)
  svnadmin create /home/svn/repos (the same server ip address, we can create multiple For example, we can create a repository named repos2 at the same time, svnadmin create /home/svn/repos1) After
  executing this command, svn will automatically add the necessary configuration files in the repos directory.
  Note: The repository is different from the general Folders, newly created files directly on the operating system cannot be recognized by SVN. You must use commands such as import to import the files into the repository.
  This is an internal command of svn, and create is used to create a new repository. Please use svn help to view detailed instructions.
  3. Modify the repository configuration file
  vi /home/svn/repos/conf/svnserve.conf
  Each parameter function is explained in the comment of the configuration file, and the configuration here is as follows:
  [general]
  anon-access = none # Make unauthorized users unable to access
  auth-access = write # Enable authorized users to have write permission
  password-db = passwd # Specify the password file path
  authz-db = authz # Access control file
  realm = /home/svn/repos # Authentication namespace, subversion will be displayed in the authentication prompt and used as a credential The cached keywords.
  Others use the default configuration. Each statement must be written in the top box, and no spaces on the left, otherwise an error will occur.
  4. Configure the user (svn changes the user name or permissions or password without restarting to take effect immediately)
  vi /home/svn/repos/conf /passwd
  enter the following:
  [users]
  username1 = password1
  username2 = password2
  You can add more than one, this is a username and password pair.
  5. Configure permissions (svn changes the user name or permissions or password without restarting to take effect immediately)
  vi /home/svn/repos/conf/authz
  This configuration file sets the authorization of each user.
  Including read-only r, read-write rw. Users who are not listed are not allowed to access. You can also group users, please refer to the svn manual for details. The following is a simple example:
  #Set permissions for the repos root directory of the warehouse
  [repos:/]
  user1 = rw
  user2 = r
  6. Use import to import the file    The
  newly created version library is empty, and the working directory needs to be imported.
  //This statement will import the files found under the path /home/user/code into the Subversion repository you created
  svn import /home/code/ file:///home/svn/repos/ -m "comment"
  3. Start the service
  svnserve -d -r /home/svn/ (note that the directory address for starting the service here is the parent directory of the newly created version library in the svnadmin command)
  4. Operations such as client initialization and update (client operation of the svn library The address is written from the root directory of the directory started by the svnserver command (not including the name of the startup directory itself), not from the directory corresponding to the svnadmin command as the root directory. The name of the repository corresponding to svnadmin is used when the client accesses When the version library, then the version library name should be included in the svn path of the client to access the current version of the svn)
            svn checkout svn://ip/repos (The same server ip address, we can create multiple repositories, such as initializing svn checkout svn://ip/repos1, such as svn checkout svn://101.200.90.101/web/centos7 It should be noted that, as shown above, the directory we actually updated includes and only includes the last directory in the svn path. For example, we enter the cd /var/www directory on the client and execute svn checkout svn:/ /101.200.90.101/web/centos7, then our directory structure on the client is /var/www/centos7/..... multiple descendant directories and multiple related descendant files, that is, don’t repeat manually creating a centos7 directory on the client )
            Svn update svn://ip/repos (checkout is used when the client loads the initialization library for the first time, after entering checkout, you will be asked to enter the account password, and update the file with update in the future, no need to enter the account password again)****

Guess you like

Origin blog.51cto.com/14949983/2539701