XCode's built-in SCM and SnapShots

Source: Internet
Author: User

XCodeBuilt-in Source Control Manager (SCM) AndSnapShotsUsage is the content to be introduced in this article. As the code is updated, we always need to change the code from time to time, or use the current code for testing, however, when you do not forget to back up the data, many developers will collapse the source file when writing the test code. On Mac,XcodeSome code management methods are provided.

1. Let's talk about it first.XCodeBuilt-inSCMTool. This tool is mainly used to share the same code in the project team and put the source code on the server. Of course, it is also good for personal code management. 1.1 Let's Talk About configuring the server first, the main is to first create a svn Library (I mainly use this machine as the server for configuration, if you use another configuration is the same, see http://www.cocoachina.com/bbs/htm_data/2/0808/317.html

Open the terminal-> cd to the directory you want to install-> svnadmin create lib, as shown in the figure below

1.2 xcode SCM Configuration

These are all taught by yile. Thank you. 1.3 configure Repositories select Repositories through the SCM option in the XCode menu. here you should be able to see the added Repositories, as shown in test, import can be used to Import project files (remember to delete the build folder for the imported project, otherwise errors will occur during future synchronization, because this contains a lot of user information and system configuration information), you can download the latest source code using the Check out option. The create Directory, Copy, Move, and Delete statements in the following sections are not described in detail, I think you can understand it as soon as you use it.

1.4 open the project by using the SCM management project. In the Xcode> SCM menu, select confiure SCM for this project... the following dialog box is displayed. Select your own Repositories. If TestSVN is selected

Next let's take a look at the center of gravity we want to see. In the select project file-> get Info, you can call up the dialog box.

Of course, for each file, you can also select the file-> get Info to bring up the same dialog box. here we can see your own object annotations and modification records, you can compare any record with the current project, or update to a revision. you can also use the sub-menu of XCode> SCM to perform operations.

After a file is changed or updated, it is marked as follows:

The following is an overview of the file's label status:


 
After changing the code, you can select a file or project, and then select commit changes... note: If a file project contains project file and user file, the project file is a project. xcodeproj is named. If we modify the atomicity, we must commit this file at the same time. For example, when we add or delete a file, when we synchronize the added file to repositories, the project must be synchronized at the same time. xcodeproj file.

Let's take a look at the SnapShot function. It seems to be added only after XCode 3.0. This function is useful for managing personal source code, but cannot work together, let me briefly introduce it.

1. When we open a project, Make Snapshot and Snapshots are included in the File menu. We can all use these two menu items.

2. After you select Make Snapshot, you can open the SnapShots dialog box to view your processing. Of course, you can annotate it.

3. manage projects

When you see the dialog box above, I think you will basically use it. Right, it's so easy to use. You can restore it to any of your statuses, you can also compare and annotate two files. of course, I think it's my responsibility to find out if we change to another machine, will it be lost? No, in ~ /Library/Application Support/Developer/Shared/SnapshotRepository.SnapshotsWhen you change the machine, you will not lose the history changes to the project. However, you need to configure a plist file in SnapshotReository, because the path and other common information of your original project are saved here, I believe you can understand it at a glance.

SCMThe main function of the options in is to synchronize and compare the code. I am also in the learning stage. If there is anything wrong, please give us some advice. add to Repository -- when adding files to the project, select this project to add the newly added file to the Resolved on the server -- this item should be used to determine whether to synchronize the file when the file you modified conflicts with the file stored on the server, take the current file as the standard, but I have not used Commit Changes to manage my code... -- synchronize your own file changes to the server. This is quite common. This option can be selected when M, A, and so on appear before the file, and you have to confirm the change. discard Changes... -- discard all current changes and roll back to last vision

Both the Compare With and Diff With options are used to Compare files. You can try different options by yourself. Compare With compares two versions of files, diff With provides different information about the two files.

Commit Entire Project .. -- This is similar to the Commit Changes function, but this is to synchronize the Refresh Entire Project to the Entire file -- Refresh the local Project file Update Entire Project -- Update the local Project file and synchronize it with the server.

Summary:XCodeBuilt-in Source Control Manager (SCM) AndSnapShotsThe usage is complete. I hope this article will help you!

Here is a link to the ADC documentation. You can refer to this link for more details if you have gone through the English language.

Https://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/XcodeSourceManagement/10-Introduction/chapter_1_section_1.html

Related Article

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.