Instructions for using SVN under centos6.5 _linux

Source: Internet
Author: User
Tags commit svn svn client svn update file permissions port number

Under Linux to build SVN server article has been a lot of, here only to write down their recent use of some of the practice of talking, the principle of first do not delve into, for future reference.

Installation: yum install subversion -y available to rpm -ql subversion view SVN installation directory, default in the/usr/bin directory

To create a version library:

Mkdir/path/to/repo

svnadmin Create/path/to/repo

After the creation of the directory there will be the Conf db format hooks locks README.txt These files (clips),

Where Conf is the profile information related to the problem of login account, hooks is the hook file will be on the server side to perform some of the response of the client action events

Configure User/Development Group information

Modify CONF/PASSWD, directly appended to the username = passwd string plaintext, where the username is the user name that exists in Linux,

Revise conf/svnserve.conf , comment out that several exercises take effect,

anon-access,auth-access,passwd-db,realm,

Modify anon-access = none at the same time

This allows the client to have read log file permissions, to facilitate viewing different versions of the submission log information,

Modify Realm =/path/to/repo Specify the SVN version library directory.

A simple configuration of personal development here is done, with svnserve-d-r/path/to/repo

You can start the SVN process and then use the client to connect Svn://ip:port/repo use, where the default port is 3690,

If you want to open more than one SVN version library to a different directory, just repeat the steps above to the start of the specified port number can be,

Like using port 3691 to start a new SVN version library: svnserve-d--listen-port 3691-r/path/to/repo

So the URL is Svn://ip:3691/repo when the client is connected

Development Group Configuration

Multiple user development code in the same group, each user to generate an SVN version of the library and then point to the same Code directory this is very cumbersome and inconsistent with the specification,

This is the time to use the SVN member group configuration:

Modify Conf/authz file, edit:

# Add Development user Group groupName1
[groups]
groupname1= Username1[,username2,username3 ...]

# Add a development group read and write permissions to the code directory
[/path/to/repo]
@groupName1 = RW

The username1,username2 user here needs to be a user in Linux, and the corresponding SVN password is already specified in CONF/PASSWD.

Here we configure the configuration of a group member, the test is OK.

Post-commit Hook Configuration

A rough understanding of the SVN client is that the modified information is transmitted in a certain format to the server and stored in a fixed format file.

The information in these files is then taken into the code directory when SVN up.

We sometimes need to see Code update information in real time on the server, which uses the Post-commit hook:

Triggers the server to/path/to/repo execute SVN up to update the file when the client commits

At the same time reduce the size of the log file to prevent the server from the log loss after the machine.

To the SVN version library configuration information directory,

CD hooks,

CP Post-commit.tmpl Post-commit

Edit Post-commit: Comment out the last line, add

Export Lang=en_us. UTF-8

/usr/bin/svn Update--force/path/to/repo

Here hook hooks are configured, restart the SVN process, you can see the client commit file synchronization update.

This is the simple use of SVN under the CentOS, to meet the day-to-day development needs are sufficient.

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.