There is a master branch in the project. dev forwarded from it, and branches of individual fixes come from dev, let's call fix .
Those. the project looks like master -> dev -> fix . After merging the dev and fix branches, the fix branch was saved in the repository.

 git checkout dev git merge master <<Ρ‚ΡƒΡ‚ измСнСния ΠΏΡ€ΠΈ слиянии>> git branch > fix >*dev > master 

Should it be removed or should it hang there?

    2 answers 2

    You can quite easily remove. Many people do just that, so that they simply would not have blighted the eyes in the list of branches.

    Nevertheless, it is absolutely not necessary - if you do not want, you can leave it.

    Well, of course, it’s not worthwhile to delete the permanent branches that the team wants to use for the ongoing development process, for example, created to match the same Gitflow Workflow . Those. If you say that you have developed the develop branch into master, having finished working on some functionality, then constantly deleting the develop branch after merging is an extremely stupid idea.

      In most cases, after a merge, you can safely remove a waste branch.

       git branch -d имяВСтки 

      If git considers that the branch has not been completely merged, it will show a warning and refuse to delete the branch. If you are sure that you need to delete a branch (using the git branch -D имяВСтки ) that is not fully merged yet, you need to take a few additional steps to clean up the unlinked commits.

      There are a number of cases when the branch is recommended to save. For example, if this is a branch of new features (new features), then you may want to edit this feature (feature) inside a merged branch.

      This is a translation of the answer Jonas Wielicki https://stackoverflow.com/a/14005910

      • Jonas Velitsky in his answer did not write what is recommended. The decision to delete or not delete depends entirely on the development agreement in your team. - Sergey Rufanov
      • "it's safe to delete the branch" - not "recommended", but "possible, safe" - Nick Volynkin ♦
      • one
        Thanks for the comment, translation corrected - atom-22
      • @ atom-22 but in general it turned out well, translate more. - Nick Volynkin ♦