例如,我在开发 feature/user
用户管理模块,提供用户的名称,信息等等, 我的同事在开发 feature/login
登录系统,他需要我的用户模块来检测是否可以登录,获取用户信息等等。
问题1:
假设我已经完成了用户系统,那么怎么给我的同事让他使用?
难道是我先 finish
, 同事再 finish
, 同事再 start
么?不太现实。
问题2:
假设我没有完成用户系统,但是我完成了同事所需要的内容,那怎么给他使用?
难道是我先 finish
, 同事再 finish
, 我和同事再 start
,分别继续开发么?
这些有什么好的解决方案么?
补充:首先主要是时间太紧张了,一个人肯定写不来,所以要多个人一起,可是多个人又会牵扯依赖问题。所以想知道如何解决这个问题。
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