For example, I am developing the feature/user
user management module to provide the user's name, information, etc., and my colleague is developing the feature/login
login system. He needs my user module to detect whether he can log in and obtain user information. etc.
Question 1:
Assuming that I have completed the user system, how can I give it to my colleagues for him to use?
Should I say finish
first, then my colleagues finish
, and then my colleagues start
? Not very realistic.
Question 2:
Suppose I have not completed the user system, but I have completed what my colleague needs, how can I let him use it?
Could it be that I finish
first, my colleagues finish
next, and my colleagues and I start
continue the development separately?
Are there any good solutions for these?
Supplement: First of all, the main reason is that time is too tight. One person will definitely not be able to write it, so multiple people need to work together, but multiple people will involve dependency issues. So wondering how to solve this problem.
Since you did not mention whether you are developing under the same project; I will assume that you are working on the same project. Before explaining what I mean, please take a look at the following points to see if you are clear about them:
The nodes of git are equal
git supports ssh, http, file and other protocols
My suggestion:
Suppose John and Jane collaborate on the same project;
John creates a project demo, which is in his personal directory;
If Jane and John are on the same development machine, then she can clone John’s code directly in her home
Now John can continue to develop, Jane can also continue to develop, and both of them can continue to submit;
Since Jane directly cloned John's code, git naturally records the address of another developer in Jane's directory. Its name is remote, and the specific content is in .git/config. The configuration field name is origin; Jane
can directly pull all updates from the origin source into her own code;
The question is, what if John also needs Jane’s code? Since John’s git project does not have any other development node information, he needs to add it manually; after adding it, he can pull Jane’s updates at any time;
Now John and Jane can pull each other’s code into their own folders; develop happily;
I think this requirement conflicts in terms of division of labor
One module is strongly dependent on another module, so it must wait for it
So refine your needs
After the User module is completed, you can submit it
At this time, you branch your module and continue
Your colleague branches his module and continues
This is standard procedure
There is a concept called continuous integration. The earlier you perform integration operations, the better it will be for your code.
The concept that extends downwards is called continuous delivery, which is all designed to cope with this kind of environment. You can refer to it
For this situation I recommend this method:
From
feature/user
分支上开出一个新的分支feature/user_login
当
feature/user
开发进入到可用的阶段时, 把代码往feature/user_login
上合并这样
feature/user_login
可以直接进行测试当
feature/user_login
开发完毕后,合并到feature/user
上最后
finish
feature/user
This is how
feature/user_login
作为feature/user
的一个子功能开发的如果再做功能的时候不是这样设计的, 那最好还是将
feature/user
finish
后再开发feature/login