search

Home  >  Q&A  >  body text

Team collaboration - What should I do if someone needs the feature I wrote as a dependency in git flow?

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.

伊谢尔伦伊谢尔伦2813 days ago814

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-05-02 09:30:14

    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:

    1. The nodes of git are equal

    2. 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;

    cd /home/John/demo/; 
    git init
    git add .
    git commit;
    • If Jane and John are on the same development machine, then she can clone John’s code directly in her home

    git clone /home/John/demo/ #Jane应该具有该目录的权限
    • Now John can continue to develop, Jane can also continue to develop, and both of them can continue to submit;

    git commit #John
    git commit #Jane
    • 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;

    git pull --rebase origin
    • 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;

    git remote add jane /home/Jane/demo/
    git pull --rebase jane
    • Now John and Jane can pull each other’s code into their own folders; develop happily;

    reply
    0
  • 高洛峰

    高洛峰2017-05-02 09:30:14

    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

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-02 09:30:14

    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

    reply
    0
  • Cancelreply