-1

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 (function1() and function2()).

They work how I want them to, but I now want to attempt to merge function1() and 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 function1() and 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 function1() and 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?

  • Sounds to me like you've got it all figured out. Seems like a good plan – matt_lethargic Nov 21 '18 at 11:15
  • 1
    Is a downvote really necessary here? It's a perfectly valid question and a helpful comment would have been much more useful. – MusTheDataGuy Nov 21 '18 at 11:32
  • Really? Another downvote? I don't understand why people can't just raise their issues with the question via comments instead of downvoting - it would be much more constructive that way. – MusTheDataGuy Nov 21 '18 at 14:23
0

Starting a new branch from your dashboard branch is the way I would do it. I sometimes prefix these with "R&D".

Remember that a branch is just a label on a commit. Keeping dashboard where it is makes it easy to go back to that commit where you know everything was working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.