Create SVN code library under Linux

Source: Internet
Author: User
Tags svn client

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 A: what?        xx: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/firsttest

This creates our first code repository, the name of which is called "Firsttest", and you can see the files

firsttest/  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]  for unauthenticated### and Authenticated users.   " Write " " Read ",

Where editing is required, respectively

2.1)

" None " .  The sample settings below is the defaults. # anon  -access = read# auth-access =  Write# # # # # password-db option controls the location of the password

Revision changed to

" None " .  The sample settings below is the defaults. Anon  -access = noneauth-access =  Write# # # # # password-db option controls the location 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)

default password file. # password  -db =  passwd# # # Authz-db option controls the location of the authorization

Switch

default password file. Password  -db =  passwd# # # Authz-db option controls the location of the authorization

2.3)

default authorization file. # Authz  -db =  Authz# # # # This option specifies the authentication realm of the repository.

Revision changed to

default authorization file. Authz  -db =  Authz# # # # This option specifies the authentication 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"

==123456

4) Modify the Authz file

# Vim Authz

Add two lines at the end

# [repository:/baz/=* = 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

# SVN Co svn://192.168.1.105:/firsttest--username woshihehe Certification area: <SVN://  192.168.1.105:3690> My First Repository

Then enter the password then you can.

----------------------------------------------------------------------- Attention !   your password, for authentication domain:   <svn://192.168.23.216:3690> My first Repository  Can only be saved in plain text 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 canavoid this warning again by setting the option "store-plaintext-passwords" to "yes" or "no" in "/root/.subversion/servers". ----------------------------------------------------------------------- Save the unencrypted password (yes/no)? Yes 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.

Create SVN code library under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.