What do you do with your branch after a pull request on GitHub?

后端 未结 3 836
孤城傲影
孤城傲影 2020-12-09 01:10

My team is experimenting with using GitHub pull requests for code reviews. My only question is what do you do with the branch after you\'re done? I would think you\'d want t

3条回答
  •  青春惊慌失措
    2020-12-09 02:15

    The rule of thumb that we use (which is here some where on Stack Overflow) is "branches are for work, tags are for history".

    Whenever a branch is merged (most likely into master) we tag the merge point using the name of the branch with the prefix "branch" (e.g. branch-topic). Then delete the branch. If we need to resurrect work at the branch point we have the tag to be able to do that.

    There are of course exceptions. We have long running branches that we use for various kinds of continuing work. But in general, topic branches are deleted after merging.

    On that note, those merges are always done with

    merge --no-ff 
    

    This ensures that there is a merge point and a record of the merge occurring.

提交回复
热议问题