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 anotherdevelop
Branch.
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 branch
To 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 isdevelop
One 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 local
xiaoming_gittutorial
Branch for development.
- Each person can only push the remote branch directly in his/her own branch.
- The following conditions must be observed during merge.
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!