1. Install SVN client
2. Create SVN code Library
1. Install SVN client
1.1. Install with command
1) CentOS
$ yum Install Subversion
2) Ubuntu
sudo apt-get install subversion
1.2. Source code Installation
Http://www.cnblogs.com/fengbohello/p/4142810.html
2. Start the SVN service process
2.1, my habit is to put the code warehouse in the/OPT/SVN directory, so first create the directory/OPT/SVN
$ mkdir/opt/svn-p
2.2. Start the SVN service process
Svnserve-d-r/opt/svn/
The purpose of this command is to open the SVN service process and use the/opt/svn/directory as the root directory of our SVN service. Later, when we want to checkout the code on the client side, the SVN service process starts the query from here, similar to the role of the Apache/var/www/directory.
Run the following command to check if the SVN service is turned on.
# Ps-ef | grep svnroot 2572 1 0 09:22? 00:00:00 svnserve-d-r/opt/svn/
If this is the case, the SVN service is turned on properly.
2.3. Create our first code warehouse: firsttest
# cd/opt/svn/# Svnadmin Create Firsttest
This creates our first code repository, the name of which is called "Firsttest", and you can see the files
# ls firsttest/readme.txt conf db format hooks Locks
2.4, the following for our code warehouse to set permissions
1) Enter the Conf directory
# CD firsttest/conf/
2) Edit svnserve.conf. This file is to tell the SVN service process, the authentication permissions of our Firsttest project and the password files required for authentication and where the authentication files are stored.
Find "[General]" on line 8th and edit the contents below.
# vim svnserve.conf### Visit http://subversion.tigris.org/for more information. [general]### These options control access to the repository for unauthenticated### and authenticated users. Valid values are "write", "read",
Where editing is required, respectively
2.1)
# # # and "None". The sample settings below is the defaults.# anon-access = read# auth-access = write### the password-db option controls th e Location of the password
Revision changed to
# # # and "None". The sample settings below is the defaults.anon-access = Noneauth-access = write### The password-db option controls the LO cation of the password
Note that there are no spaces in front of the two red lines, no SVN will read the failure, and the following changes should be noted.
2.2)
# # # Uncomment the line below to use the default password file.# password-db = passwd### The AUTHZ-DB option controls the L Ocation of the authorization
Switch
# # # Uncomment the line below to use the default password file.password-db = passwd### The AUTHZ-DB option controls the LOC Ation of the authorization
2.3)
# # # Uncomment the line below-The default authorization file.# authz-db = authz### This option specifies the Authent Ication realm of the repository.
Revision changed to
# # # Uncomment the line below-the default authorization file.authz-db = authz### This option specifies the authentic ation realm of the repository.
For the general situation, modified to here can be, the following options are encryption options, such as the enhanced version, here does not say.
3) Modify the passwd file below.
# vim passwd
3.1) Find "[Users]", under this option add User "Woshihehe", "woshihehe" user corresponding password is "123456"
[users]# Harry = harryssecret# sally = Sallyssecretwoshihehe = 123456
4) Modify the Authz file
# Vim Authz
Add two lines at the end
# [repository:/baz/fuz]# @harry_and_sally = rw# * = R[/]WOSHIHEHE=RW
These two lines mean that all files under the directory [/] (code root), if there is no special convention, the Woshihehe user will have read (R) and write (w) permissions.
3. Download the Code
If the IP of my svn server is 192.168.1.105, on the other machine, execute the following code
Then enter the password then you can.
Salesman | Market Extension Staff | Marketing Staff
Mall recruit VIP Shopping rebate members and market development staff (can be part-time), to achieve the goal of guaranteed minimum annual salary of 100,000 can be signed an agreement, pay on time on a monthly basis. Phone 13012685798
-----------------------------------------------------------------------attention! Your password for the authentication domain: <svn://192.168.23.216:3690> My First repository can only be saved in plaintext on disk! If possible, consider configuring your system so that subversion can save the encrypted password. Please refer to the documentation for more information. You can avoid this warning again by setting the option "Store-plaintext-passwords" to "yes" or "no" in "/root/.subversion/servers". -----------------------------------------------------------------------Save unencrypted password (yes/no)? Yes to remove version 0.
Fill in the yes so that we take out our code, the version is 0. This is where you can add directories and files. But this is how to use SVN, here is the detail.
Reprint: Create SVN code base under Linux