Source code git management for the app development process

Source: Internet
Author: User
Tags sourcetree

The base project can already be compiled and run, just without the actual functionality. Before we continue to refine the base project, we need to consider the code management thing.

Whether it is a person development or a team development, the source code version management is necessary, anyone to the code of any operation can be managed, the reason is not sufficient.

I've used SVN before, but the best way to do it is git.

1. The local warehouse is easy to use and can be completely detached from the remote repository.
2. All the backbone and branches are unified management, switch freely
3. Easy and enjoyable code merging

Xcode comes with code git management, which was mentioned when the project was created, which was not recommended because of the readiness to use other management tools. If you create a project using Xcode's git management, you can modify it in one of the following two ways:

Way One:
1. Open terminal, enter directive: Defaults write Com.apple.finder Appleshowallfiles-bool True (false means file with hidden type not shown)
2. Remove hidden files from the project root directory. Git
3. Using the new management software for git management

Way two:
The root folder can be versioned by simply copying the files and folders that are visible under the root directory to the new root folder.

Source Code git Management configuration

Management solution: Github + sourcetree

GitHub also provides a client to manage the project by logging in directly with the account password. Also useful command line to control the friends, I will not discuss. I'm still using sourcetree to manage other projects, so I'm going to use sourcetree here.

With git, most of it involves SSH key, which simply records the build process.

SSH Key generation Process:
1. You can check if you have SSH key, open terminal, enter: Ls-al ~/.ssh
You can also go to the (shift+command+g) folder "~/.ssh" under the Finder's current user root directory
If there is a xxxx.pub file, it is the target file, open with a text editor, copy all the contents, save to the GitHub account corresponding location
2. does not exist. Input: ssh-keygen-t rsa-c "[email protected]", follow the prompts to complete the operation. Email suggestions for GitHub account email
After the build, follow step 1.

After you do this, you can use Sourcetree.

Here, we can choose to set up the remote account in Sourcetree, build the local warehouse based on the base project, and then create the remote warehouse based on the local warehouse. You can also set up a repository named "base" on GitHub, and then use SSH to clone to the local, and then move the project file into it without setting up an account. I used the latter.

After you open the local repository, you can see that the file is not staged.

Description: I put the project created by Xcode and the Sourcetree clone down to the same folder, in order to distinguish, the cloned root directory renamed to "Githubbase".

For the use of Sourcetree, only the following points are recorded:
1. Check the file that is not staged, you can add to the list of files that have not been staged, that becomes the file to be submitted
2. The "Submit" button in the upper left corner, just submit the changes to the local warehouse
3. The push button is submitted to the remote repository
4. The "Pull" button is the latest code for synchronizing the remote repository
5. You can right-stage the file, "ignore" This file or this type, for example. Xcworkspacedata
6. The "Branch" button can create a new branch, specific to the branch or trunk version, right-click can checkout toggle the current editing branch
7. Right-to-non-edit branch, can be merged into the current branch
8. Right-click on a file to view the change log
9. Resolve conflicts You can use the Outreach tool

More detailed features and operations are not documented.

At this point, the source code has been managed.

Source code: Https://github.com/ALongWay/base

Source code git management for the app development process

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.