Do you feel comfortable merging code?

前端 未结 18 2021
心在旅途
心在旅途 2021-01-31 04:50

This morning, I read two opinions on refactoring.

  • Opinion 1 (Page not present)
  • Opinion 2 (Page not present)

They recommend branching (and s

18条回答
  •  盖世英雄少女心
    2021-01-31 05:04

    Branching is trivial, as most have answered, but merging, as you say, is not.

    The real keys are decoupling and unit tests. Try to decouple before you branch, and keep an eye on the main to be sure that the decoupling and interface are maintained. That way when it comes time to merge, it's like replacing a lego piece: remove the old piece, and the new piece fits perfectly in its place. The unit tests are there to ensure that nothing got broken.

提交回复
热议问题