Arquisoft / faq

Frequently asked questions - Software architecture course
MIT License
4 stars 0 forks source link

Usage of branches #36

Open uo282892 opened 1 year ago

uo282892 commented 1 year ago

I have a question regarding the branches in Github.

If we merge a branch in develop, and we later want to make a change (update, modify something) in what we implemented in that branch, is it better to work on that branch (merging develop to it to avoid conflicts), or do we create a new branch?

This is related to another question, which is the following. Once we merge a branch, is it suitable to delete it right at that moment or should we keep it for some time? For example, until we deliver what we are doing (for you to see how we worked, for example, or other reason). @pglez82

pglez82 commented 1 year ago

Hi,

If we merge a branch in develop, and we later want to make a change (update, modify something) in what we implemented in that branch, is it better to work on that branch (merging develop to it to avoid conflicts), or do we create a new branch?

Both options are acceptable, but I prefer creating a new branch, even for after merge quick fixes. It is just a question of workflow. Obviously, if you merged the branch "by error", you could keep working on that branch and then make a new pull request, no problem.

This is related to another question, which is the following. Once we merge a branch, is it suitable to delete it right at that moment or should we keep it for some time? For example, until we deliver what we are doing (for you to see how we worked, for example, or other reason).

It is perfectly safe to delete it after merging. If you keep all the branches you will end with quite a lot of them and it can be a mess. You can also keep some of them. Again, it is a matter of taste.

Pablo