Use of MacOS under SVN

Source: Internet
Author: User
Tags svn svn client svn update

The GIT management project that I used to use on my Mac, to the new department, is the SVN, which describes the use of SVN under MacOS.

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.

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 terminal, create a mycode warehouse, enter 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:

Configure user permissions for SVN

The main is to modify the/svn/mycode/conf directory of three files

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

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], such as:

    1. [Users]
    2. MJ = 123
    3. JJ = 456

The account number is MJ, the password is 123.

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

    1. [Groups]
    2. Topgroup=mj,jj

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

The above configuration instructions Topgroup all the users in this group have read and write (rw) permissions for all repositories, and the group name is preceded by the @

If it is a user name, do not add @, such as MJ This user has read and write permissions

    1. [/]
    2. MJ = RW

For other fine-grained permission controls, you can refer to other content in the Authz file

4. Start the SVN server

Before 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 enter:svnserve-d-r/users/apple/svn/mycode

Without any hint, it means the boot was successful.

5. Close the SVN server

If you want to shut down the SVN server, the most effective way is to open the utility's "Activity Monitor"

Together, we can easily build an SVN server environment.

Using the SVN client feature

1. Import code from local to server (first initialize import)

Enter in the terminal

SVN Import/users/apple/documents/eclipse_workspace/weibo Svn://localhost/mycode/weibo--USERNAME=MJ--password=123 -M "Initialize import"

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 comment

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

Enter svn checkout svn://localhost/mycode--username=mj--password=123/users/apple/documents/code in the terminal

I explain what the instruction means: Download the contents of the Mycode repository in the server to the/users/apple/documents/code directory

3. Commit the changed code to the server

In 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 terminal, first locate to/users/apple/documents/code directory, enter:cd/users/apple/documents/code

2> Input Submission Instructions:svn commit-m "modified main.m file"

This command will synchronize all changes under/users/apple/documents/code to the server side, if I only modified the main file this time.

You can see the print information for the terminal:

    1. Sending WEIBO/WEIBO/MAIN.M
    2. Transmitting file data.
    3. Committed revision 2.

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. For other uses of SVN, you can enter in the terminal:svn Help

Here's a bunch of SVN instructions, and the rest of the parentheses will generally represent the abbreviation of the instruction, for example, we can use SVN ci instead of SVN commit and SVN co instead of SVN checkout

Original link: http://blog.csdn.net/q199109106q/article/details/8655204

Subsequent additions:

Flash Builder4.7 installed svn1.8 plugin, or prompted Subversion native library not available, modify the FB settings svn svn excuse

----------

Add SVN service boot up

In Etc/rc.local (to create) file, add svnserver-d-R user/apple/svn/rep (SVN directory)

If permissions are insufficient, sudo is required ....

Use of MacOS under SVN

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.