Imagine the scenario:
You are in develop
branch currently.
You created new branch. Lets say A
You made some commits.
But then you realized this is a hotfix and it should be based on master
branch. And develop
has some changes that shouldn't be in the master
branch, yet. (gitflow)
So whats the easiest way to carry of all the changes to a new branch based on master
?
This happened to me today. And my (stupid) solution was:
- Delete
A
- Memorize all the changes you have made.
- Checkout to
master
. - Create new branch.
B
- Apply your changes to this new branch.
There has to be better way! :)