I would like to know if it's better to delete your branch after merging to master or if we should continue to work on the same separate branch during all the project.
i.e If we are 3 members in the group, each of us create his own branch and works on it during the duration of the project. We all commit in the master branch and pull before we start working on something else. In that way, we know who's working on which branch and we don't get confuse.
Thanks.
So there are tons of literature about how to manage your branches but really I think it comes down to how you want to manage things within your own project. That being said, here is a link for branch workflow from Atlassian that could give a decent opinion:
https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow
Now, all that long article being said, if it makes sense for you all to commit straight to master, I don't think there is anything wrong with that. I personally commit to master for a couple small projects I work on but generally, this is the flow I follow:
Widget X
.feature-widget-x
.feature-widget-x
and make a branch called michael-error-handling
.Widget Y
.I want to note that this is strictly how I do things and has been successful for me in companies where it has been implemented. It may or may not be the best solution for your group of three members though but that is for you to decide. If you do go with this plan, it has the benefit of being able to roll back to a feature as needed and the only branches that persist are the feature branches and the master branch. Much easier than looking through commit logs on a single branch to figure out when you should roll back to if a commit breaks something.
Hopefully this helps. Here are a couple more links below for extra reading:
https://git-scm.com/docs/git-archive
https://git-scm.com/book/en/v2/Git-Basics-Tagging
How can I archive git branches?
The correct answer to your question is: it depends what you want to do. There is no problem with continue working on the branch that you merged with master. You can also simply delete it if you don't need it ! However, in the setting you describe, I totally agree with the fact that if you work on different parts of the project, then it may be safe to create different branches and keep the master branch as clean and updated as possible for the group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With