Use SVN in XCode

Source: Internet
Author: User

Xcode is the quickest way for developers to build Mac OS X applications. It is also the easiest way to use the new Apple computer technology, while SVN is a version control tool, so what is Xcode SVN? How to configure Xcode SVN?

How to configure Xcode SVN
  

The Mac comes with svn, so we don't need to download it. We can use it with a slight modification to the subversion configuration. Two methods are taught:

Step 1: Configure Subversion

Leopard comes with SVN, but not all files in Xcode project files are suitable for management in SVN, such as compiled files and files generated during compilation, these files do not belong to the source code. svn should be told to ignore them. The method is as follows:

 

Edit ~ /. Subversion/config file

Note: If the ". subversion" directory does not exist, run the "svn status" command. Although this command will fail, it will create the required files for you.

Open ~ /. Subversion/config open the file

1. Find a global-ignores line, remove the comment, and edit it

Global-ignores = build *~. Nib *. so *. pbxuser *. mode *. perspective *

Some files in the Xcode project file are text files and need to be told to SVN, because SVN can better manage text files (who knows who to use)

2. Find enable-auto-props = yes and remove the comments. declare the following text file in [auto-props] Section:

*. Mode * = svn: mime-type = text/X-xcode
*. Pbxuser = svn: mime-type = text/X-xcode
*. Perspective * = svn: mime-type = text/X-xcode
*. Pbxproj = svn: mime-type = text/X-xcode

Step 2: Configure Xcode

The familiar Version Control is called SCM (Software Configuration Management) in Xcode. We can see it all day after learning cmme. It turns out to be Version Control ),

1. Select SCM> Configure Repositories from the Xode menu and enter the SVN server information.

2. Select SCM-> Repositories and you can Import and Check Out the content you want. You can also perform routine SVN management here.

3. After the Checkout project is completed, set the project SCM in the properties of your project.

4. after setting, you can see a new column in your project view. M indicates that the file has been modified, and then you can use the SCM menu, you can also right-click the menu to directly perform SVN operations, such as commit, update, revert, diff, and log.

SCM-> Get SCM Info to view the version information of any file

**************************************** **************************************** ********************

Svn configuration in mac

0. Create a directory for saving the software repository.Enable Web Sharing in system settings.
Sudo su (then enter the password)
Mkdir/opt
Mkdir/opt/svn
Mkdir/opt/svn/repos
The directory/opt/svn/repos/is created/

1. Create a version Repository Svnadmin create/opt/svn/repos

2. Modify the authorization Configuration
Go to the repository configuration directory cd/opt/svn/repos/conf
(1) edit the configuration file vi svnserve. conf to cancel the comments of the following lines.
Anon-access = read
Auth-access = read
Password-db = passwd (password configuration SAVING file)
Auth-db = authz (authentication configuration SAVING file)

 

(2) edit the password configuration file vi passwd
Format: "user name = password"
(3) edit the authentication file vi authz
Format: [groups]
User Group name = user group member
[Directory to be authorized]
@ Group name = permission
User name = permission
For example:
[Groups]
G_developers = jcccn, jesse, bill
G_tester = jerry, wang
[/]
@ G_developer = r
Jcccn = rw
* =
[/Jcccn]
@ G_tester = rw
Jcccn = rw
* = R
(4) Configure to ignore the file vi ~ /. Subversion/config
Find the global-ignores line, remove the comment, and edit it
Global-ignores = build *~. Nib *. so *. pbxuser *. mode *. perspective *
Find enable-auto-props = yes and remove the comments. declare the following text file in [auto-props] Section:
*. Mode * = svn: mime-type = text/X-xcode
*. Pbxuser = svn: mime-type = text/X-xcode
*. Perspective * = svn: mime-type = text/X-xcode
*. Pbxproj = svn: mime-type = text/X-xcode

3. Start svnserve:
Svnserve-d-r/opt/svn/repos
Killall-9 svnserve can be used to end the service

4. Configure SVN in Xcode
(1) Select SCM> Configure Repositories from the Xode menu, click the plus sign on the left, enter the repos Name in Name, select subversiion in SCM, and enter the SVN server information.
Name: repos Name, for example, jcccn
Scheme: svn
Host: Host address, for example, 192.168.1.104
Path: Path such/
User: User Name
Password: Password

(2) Select SCM-> Repositories to create a folder. The daily management of SVN can also be done here. Click Import and select the project for version control.

(3) Check out! Select a project, click Check out, and select the target location. It is equivalent to initializing the project with svn and adding some control information. This step is very important. If it is missing, version control will not be available.
(4) Open the project after Check out, click the project property Get info, and select SCM Repository as your configuration in general.
(5) After setting, you can see a new column in your project view. M indicates that the file has been modified, and then you can use the SCM menu, you can also right-click the menu to directly perform SVN operations, such as commit, update, revert, diff, and log. For commit, it is best to enter the details of the message version with respect to the previous version.

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.