Configure xcode SVN from scratch

Source: Internet
Author: User

I. What is SVN used?

 
If you have never touched SVN, this article may be helpful to you. A large project is always under development by many people, and each person updates the source of this project.
Code, SVN is to help you maintain and manage the source
Code. (SVN is really a rare good thing! It is strange that there are so many people working on such a large LTE project. How can no one in the lab advocate using SVN ?)

I was so stupid when I first started learning iPhone! The code needs to be modified again and again, but sometimes it cannot be run after modification and no error is found. It is easy to "Restore" the original version and re-modify it.
At that time, I had never heard of SVN taking a lot of detours. I manually stored a lot of versions for each project, and finally I did not know which version can be used but could not be used, it is time-consuming, laborious, and
Inefficient! Later, Yile taught me how to configure and use SVN on xcode. Productivity suddenly moved from the primitive society to the feudal society, saving a lot of trouble. Thank you ~

Ii. configuration method

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 have been greatly taught: method 1. which is suitable for teamwork?
Code is put on the server so that everyone can download and update it. However, this type of server is usually charged (whether a server is available in the company's Intranet, I haven't learned this yet
); Method 2: If it is only used to manage your own programs, you can directly configure the local machine as a server ~

Method 1:
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
 
1. Find a global-ignores line, remove the comment, and edit it

Global-ignores = build *~. NIB *. So *. pbxuser *. Mode *. perspective *
. Ds_store
Some files in xcode project files are text files and SVN needs to be told, because SVN can better manage text files

2. Find enable-auto-Props = yes and remove the comments. In [auto-Props]
Section declares the following text files



*. 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


Go to http://svn.w18.net/to register an account number. You can use one-month trainer for free. Create a project after logging on, open
Xcode> SCM> Configure
SCM
Repositories, fill in the information such as, then we can import, checkout operation, here to explain the Library (repository) and the server, this
The relationship between machines. The library records the code information of all versions. Whether you download the updated code from the server or want to upload the locally modified code to the server (COMMIT ),
Repository; it is like a warehouse. The goods delivered and sold from the manufacturer are clearly recorded and can be found at any time. In the first use, no source is found on the server.
Code, you need to import the first source code to the library, the library automatically
The code is uploaded to the server. Next, how to update and upload the source code? You can use checkout to download the code on the server to the specified path on the local machine. After each code modification, commit
Update updates the local code to the server, and update updates the latest version on the server to the local machine. If you want to restore a previous version, update
To a specific version of revision (because the school education network cannot connect to the server, the specific operation is demonstrated in method 2 ).


Method 2:
Maybe you just want to manage your own code without a server, so you just need to use the local machine as a server.
1. Open the terminal and CD to the path you want. svnadmin create
Lib creates a database to manage and store your code. The LIB path I created is/users/Maffia/lib.
2. Configure the SCM information as follows. Next, import your project path (similar to method 1 to upload the source code to the server), and then checkout (same method 1 to download the server code to the local machine ), then the project code can be modified with you, and SCM will be smart to manage the code for you without having to worry about it.


Open the project from checkout to the local machine, SCM-> Configure SCM for this
Project, and then select the local subversion for the project. My name here is localsvn_test. In this case, if you modify the file code and add content to the highlighted part, after the file is saved, an M will be displayed on the left of the modified file name. If you do not check whether the SCM status is online.


Next, SCM-> commit will update your version to the database, and the server information will be updated accordingly. After I modify it twice, view the SCM
Info has found three versions. It is really a smart manager. So when will you be overwhelmed by changing the code? You just need to update the code to a previous version that can be used, just like time
Machine is very convenient.

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.