Git process in iOS development, iosgit

Source: Internet
Author: User
Tags how to use git

Git process in iOS development, iosgit

I believe that the advantages of Git are no longer mentioned in detail. It is not the same as that of SVN.
I used to drag files for development by many people before and cooperate with others. --!

I will not talk about some basic commands here. I will only teach you how to use Git for most practical development.

Scenario

The three developers work together to develop an app. The boss is Xiao Ming, the second is Xiao Qiang, and the third is Xiao Wei.

At this time, the boss went to github to open a repository. Of course, company projects are generally private repo.

 

After creation. The boss has four branches in this repo.
The name is
xiaoming_gittutorial,xiaoqiang_gittutorial,xiaowei_gittutorial, There is anotherdevelopBranch.

 

This is the case now.

 

Okay. Now the boss tells the other two people to clone the project from github.

 

OK. After pulling it down, entergit branchTo see which local branches are available.

 

There is only one master and branch locally. Now, let each person pull two branches from the remote branch. One isdevelopOne is the branch that represents itself. For example, James pullsxiaoming_gittutorial.

Inputgit fetch origin develop:develop

This command pulls a remote branch called develop and creates a local branch named develop to match the remote branch.

 

After pulling all the data, let's look at the local branches.

We have completed the preparatory work, and how can we ensure that merge conflict and contaminated Main Branches are as few as possible during multi-person collaboration?

In fact, it is not easy to have a big flaw when doing the following.

  • Do a Good Job of division of labor, especially storyboard and xib. Try to avoid the occurrence of multiple users modifying the same file.
  • Everyone's development work is only developed in their own branch. For example, you can switch to your localxiaoming_gittutorialBranch for development.
  • Each person can only push the remote branch directly in his/her own branch.
  • The following conditions must be observed during merge.
    • Very important

What are the benefits of such a process?

Finally, let's clarify our ideas.

1. During official development, each person only needs two local branches. One is develop and the other is its own branch.
2. Each person can directly push their own branch. But when pushing the develop branch. You must first use the latest remote develop branch of pull. Merge with the local branch, clear the conflict, and then push.

All-round programmers exchange QQ Group 290551701 and gather many Internet elites, Technical Directors, architects, and project managers! Open-source technology research, welcome to the industry, Daniel and beginners interested in IT industry personnel!

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.