Do you feel comfortable merging code?

前端 未结 18 2052
心在旅途
心在旅途 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:17

    Some loose guiding principles:

    • Branch late and only when you need to
    • Merge early and often
    • Get the right person to do the merge, either the person who made the changes or the person who wrote the original version are best

    Branching is just another tool, you need to learn how to use it effectively if you want the maximum benefit.

    Your attitude to branching should probably differ between distributed open source projects (such as those on Git) and your company's development projects (possibly running on SVN). For distributed projects you'll want to encourage branching to maximize innovation and experimentation, for the latter variety you'll want tighter control and to dictate checkin policies for each code line that dictate when branching should / should not occur, mostly to "protect" the code.

    Here is a guide to branching:
    http://www.vance.com/steve/perforce/Branching_Strategies.html

    Here is a shorter guide with some high level best practices:
    https://www.perforce.com/pdf/scm-best-practices.pdf

提交回复
热议问题