git workflow: everyone has a branch, or everyone has a master?

后端 未结 3 1316
梦如初夏
梦如初夏 2021-01-19 02:26

When working with multiple people with git, is it better

  1. for everyone to just work in master, and merge between each other\'s masters, or
  2. for everyo
3条回答
  •  盖世英雄少女心
    2021-01-19 02:49

    Branch names in git are local to a repository. push and pull can be configured to match identical names on a remote repository, but that's optional behavior. If you have a central repository, you want master there to be definitive. What individual developers call their working branches on their local repositories is really a matter of taste. Some will have their local master be their working branch, and others will use a single named dev branch.

    If your devs are up to it, the really savvy way is to use feature or topic branches, so that rather than having a "Mike's work" branch you have a "work on autofrotzification feature" branch that can be pushed and exchanged sanely without everyone needing to do a ton of early merging back and forth.

提交回复
热议问题