I have a branch (
dashboard) which I am developing a new feature on.
To make the example easy to follow, I am developing two separate functions (
They work how I want them to, but I now want to attempt to merge
function2() together to make
new_function() because I think it will streamline the process in future.
Note that this wasn't in my original plan - the original plan was to develop
function2(), which is why I created the
dashboard branch; however, I think that creating
new_function() might be an even better solution but I don't want to jeopardise anything I have already done.
Let me mention that I absolutely get the whole point of version control - being able to roll back, etc. - and that I could just roll back any changes that I am unhappy with; however, as I currently have
function2() working well, I think creating a new branch might be easier to manage and will also make everything simpler overall. If
new_function() is a success, I can merge it back into my
master branch; if not, I can delete the new branch and return to
dashboard, with the intention of merging that back into my
master branch once complete.
I'm sure that an aspect of personal preference will play a role here, but what is (typically) best practice in such a scenario?