MAC Build SVN Server environment

Source: Internet
Author: User
Tags svn client svn update

MAC Build SVN Server environment

First, create SVN repository
svnadmin create /path/svn/pro  //仓库位置,svn是svn的目录,pro是一个版本库的目录

PS: Here is a ambiguity, in such a way to add svn, when starting the SVN service, remember to use /PATH/SVN This path, and can not use /path/svn/pro This path, or will be reported Doesn ' t exist

Example:

Create a new SVN directory under the /user/apple directory, and later you can build multiple repositories in the SVN directory

Open the terminal, create a mycode warehouse, enter the command:

svnadmin create /Users/apple/svn/mycode

After the command executes successfully, it will find a /users/apple/svn/mycode directory on the hard disk, the directory structure is as follows:

Ii. Configuring user rights for SVN

The main is to modify the /svn/mycode/conf directory of three files: authz,passwd,svnserve.conf

1. Open the svnserve.conf and remove the # and spaces in front of the following configuration items
# anon-access = read# auth-access = write# password-db = passwd# authz-db = authz

The # number before four lines is removed, then anon-access = Read to anon-access = None, so that anonymous access is forbidden and the account password is required to access

PS: Here to note, after the # number is a space, you have to remove this space, the text shelf, or there are errors

2. Open passwd and add your account and password under [users]

The account number is MJ, the password is 123;
Account number is JJ, password is 456

3. Open Authz, configure user groups and permissions

We can assign the users in the passwd to different user groups, later, you can set different permissions for different groups of users, there is no need to set permissions for each user individually. Add a group name and user name under [groups] , separated by commas (,) between multiple users

PS: User group before using the @ symbol, if it is the user, directly write the user name on it. RM stands for read-write, obviously read-only is R .

4. Start the SVN service
svnserve -d -r /path/svn  

In particular, the path must be the SVN directory, not one of the repository directories, otherwise, can start normally, is the access problem

Without any output, the boot succeeds

Instance:

Enter the following command at the terminal:

svnserve -d -r /Users/apple/svn

Open the "Activity Monitor" in the utility as shown in:

Third, use the SVN client function 1. Import code from local to server (first initialize import) in terminal input
svn import /Users/apple/webSite svn://localhost/mycode/webSite --username=mj --password=123 -m "初始化导入"

PS: Upload all content from /users/apple/website to the WebSite directory of the server Mycode warehouse, followed by "Initialize import" in double quotes is a comment

2. Download the code from the server side to the client local

Enter in the terminal

svn checkout svn://localhost/mycode --username=mj --password=123 /Users/apple/svnwebSite

PS: Download the contents of the Mycode repository in the server to the /users/apple/svnwebsite directory

3. Commit the changed code to the server

In step 2, the server-side code has been downloaded to the /users/apple/svnwebsite directory, now modify some of the code inside, and then commit these modifications to the server

1. Open the terminal, first navigate to the /users/apple/svnwebsite directory, enter:

cd /Users/apple/svnwebSite

2. Enter the submission instructions:

svn commit -m "修改了webSite文件"

This command synchronizes all changes under /users/apple/svnwebsite to the server side,

The results are as follows:

4. Update the server-side code to the client

After locating the client code directory in the terminal, such as the /users/apple/svnwebsite directory above, and then entering the command:

svn update
5. For other uses of SVN, you can type in the terminal:
svn help

转载:Mac 搭建 SVN 服务器环境

开机自启SVN
http://www.jianshu.com/p/f949e24ea1ce

MAC Build SVN Server environment

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.