MAC Build SVN server environment

Source: Internet
Author: User
Tags svn client svn update

In a Windows environment, we typically use TORTOISESVN to build an SVN environment. In a Mac environment, because the Mac comes with SVN's server-side and client features, we can use SVN without any third-party software, but we need to do a simple configuration.

Let's start by looking at how to build an SVN server-side environment in a MAC environment.

Back to Top


Create a code warehouse to store the code uploaded by the client

I'll start by creating a new SVN directory under the/user/apple directory, and then you can create more than one repository directory in the SVN directory.

Open the terminal, create a mycode warehouse, Input directive: svnadmin create/users/apple/svn/mycode


Back to Top


Ii. Configuring user rights for SVN

1. Open the svnserve.conf and remove the # and spaces in front of the following configuration items

    1. # anon-access = Read

    2. # auth-access = Write


    3. # password-db = passwd


    4. # authz-db = Authz

Copy Code

Anon-access = Read on behalf of anonymous access, if you change to anon-access = None means anonymous access is forbidden, the account password is required to access


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

    1. [Users]

    2. Mj=123

    3. jj=456

Copy Code

The account number is MJ, the password is 123.


3. Open Authz, configure user groups and permissions

Add a group name and user name under [groups], separated by commas (,) between multiple users

    1. <font color= "RGB (0, 0, 0)" ><font style= "Background-color:rgb (254, 254, 242)" ><font face= "Verdana, Arial , Helvetica, Sans-serif ">[groups"

    2. Topgroup=mj,jj</font></font></font>

Copy Code

Note that MJ and JJ belong to the Topgroup group, and then the permissions are configured. Use [/] to represent all repositories in the SVN server

    1. [/]

    2. @topgroup =RW

Copy Code

The above configuration instructions Topgroup all the users in this group have read and write (rw) permissions to all repositories, the group name is preceded by @ if it is a user name, do not add @, such as MJ This user has read and write permissions
    1. [/]

    2. Mj=rw

Copy Code

For other fine-grained permission controls, you can refer to other content in the Authz file4. Start the SVN serverBefore the configuration of so many, the most critical or to see whether the normal start of the server, if not to start, do more work in the front is futile. Enter the following command at the terminal: svnserve-d-r/users/apple/svn or input: svnserve-d-r/users/apple/svn/mycode without any hint, the boot was successful.5. Close the SVN serverIf you want to shut down the SVN server, the most effective way is to open the utility of "activity Monitor" integrated above, we can easily build the SVN server environment

Back to Top


third, use the SVN client function1. Import code from local to server (first initialize import)Enter in the terminal
    1. SVN Import/users/apple/documents/eclipse_workspace/weibo Svn://localhost/mycode/weibo--USERNAME=MJ--password=123 -M "Initialize import"

Copy Code

I explained the meaning of the instruction: upload everything in the/users/apple/documents/eclipse_workspace/weibo to the Weibo directory of the server Mycode warehouse, followed by the "Initialize import" in double quotes is a comment2. Download the code from the server side to the client localEnter SVN checkout Svn://localhost/mycode--USERNAME=MJ--password=123/users/apple/documents/in the terminal Code I explain the instructions: Download the contents of the Mycode repository in the server to the/users/apple/documents/code directory3. Commit the changed code to the serverIn step 2, the server-side code has been downloaded to the/users/apple/documents/code directory, now modify some of the code inside, and then commit these modifications to the server 1> open the terminal, first locate to/users/apple/ Documents/code directory, enter:cd/users/apple/documents/code2> input commit command: SVN commit-m "modified main.m file" This command will/users/apple/ All changes under Documents/code are synchronized to the server side, if I only modified the main. File to see the print information for the terminal:
    1. Sending WEIBO/WEIBO/MAIN.M

    2. Transmitting file data.

    3. Committed Revision 2.

Copy Code

4. Update the server-side code to the client this should be the simplest instruction, in the terminal to locate the client code directory, such as the above/users/apple/documents/code directory, and then enter the command: SVN update 5. As for the other uses of SVN, you can enter in the terminal: SVN help lists a bunch of SVN instructions, the contents of the following parentheses generally represent the abbreviation of the instruction, for example, we can use SVN ci instead of svn commit, with SVN co instead of SVN checkout


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.