Pablo Ezequiel Inchausti
Pablo Ezequiel Inchausti

Reputation: 20523

In GitFlow methodology, should the branches be deleted both local and remote after finished and merged to develop?

I have a doubt about how to follow GitFlow methodology using basic git commands: What is the recommendation regard to delete feature branches after merge it to develop: feature branchs should be removed in both local and remote repository? or It should be deleted only in local repo after finished and merged them?

Upvotes: 1

Views: 48

Answers (1)

Mauricio Machado
Mauricio Machado

Reputation: 643

I'd say it depends. You can be either forking the main repo, or pushing your feature branch to the main repo.

If you're forking, it actually doesn't matter, since all branches are in your fork, once the feature is merged, you can do whatever you want with it. I personally don't delete them in this scenario, since because of our approach to the flow, if the QA does not approve the first merge, we have to still work in the same branch.

If you're pushing to the main repo, then yes, you should keep the repo clean, because everyone is there, and it'll be a complete mess if everyone leaves branches all the time.

And have in mind that the design of GitFlow (or any Design Pattern for that matter) is meant to be a general work idea, not an unbreakable law: Adapt it to your environment and do the changes that make sense to you.

Upvotes: 2

Related Questions