Preface:
Svn (subversion) is a version management tool that has emerged in recent years and is the successor of cvs. Currently, most open-source software uses svn as the code version management software.
Test environment:
Centos 6.3 + subversion 1.6.11
SVN installation and configuration:
Directly use yum to install subversion
yum install subversion
Run the svnadmin command to create the project directory.
svnadmin create /var/www/project
After executing the Create Project command, the following file directories are automatically generated:
* Dav Directory: Provides the directories used by apache and mod_dav_svn to store internal data.
* Db Directory: stores all version-controlled data files.
* Hooks Directory: directory for storing hook script files
* Locks Directory: used to place the subversion. See the directory for hard-locking data. It is used to track the client that accesses the file library.
* Format File: a text file with only one integer. Indicates the version number of the current file library configuration.
* Conf directory: it is the configuration file of this warehouse (the Warehouse's user access account, permissions, etc)
Go to the conf directory.
# Vim svnserve. conf [general] anon-access = noneauth-access = writepassword-db =/var/www/project/conf/passwdauthz-db =/vsr/www/project/conf/authzrealm = project ####################################### ############## vim passwd [users] dick = dicklaobi = laobi # username and password ############ ######################################## ### vim authz [groups] group1 = dickgroup2 = laobi [project: /] dick = rw # Grant dick read and write permissions @ group1 = rw # Grant group1 read and write permissions to the group [project: /laobi] # Set the permission limit for the laobi folder in the root directory. laobi = rw @ group2 = rw * = # Do not allow operations by other users without permission. This parameter must be added. Otherwise, operations by other users cannot be restricted.
Group1 and group2 are groups
[Project:/] is the project root directory
Enable and disable the SVN Server
Svnserve-d-r/var/www # ps Query Process [root @ localhost conf] # ps-ef | grep svnroot 2146 1 0? 00:00:00 svnserve-d-r/var/wwwroot 2210 1910 0 00:00:00 pts/0 grep svn
Several Basic SVN operations on the server
Pull files from Warehouse
svn co svn://192.168.2.136/project
Add File
svn add test.txt
Upload files
svn commit test.txt