gitgit-flowhotfix

Git-Flow undo a finished/merged hotfix branch


I know there are plenty of similar situations on Stack Overflow, and even the in Internet in general.

I just can't find an appropriate answer to my issue.

My situation:

I made a quick ASCII art so that you can better picture it.

    A-B———C---D-M     # Dev
     \    /
     X-Y—Z         # Release

This is a Release created days ago. On the M commit of the branch Dev, after the Release, I created a new feature, I modified a lot of code, then I finished my feature and merge.

Now imagine, at the commit N, after the Release, after the new Feature, when the feature is now merged into dev. I created an Hotfix from my previous release (ASCII Art).

This Hotfix is just an update of a specific library.

I finished the Hotfix after updating the library, then merged it to dev and master. But it screws up my Dev Branch, now I can't continue working because my Dev Branch is now old from the Release with the Hotfix modification.

My question is how to avoid this situation ?

And moreover, can I delete this hotfix from Dev and Master in order to create a new release branch from my current dev and not an Hotfix from old Dev branch?


Solution

  • Finally I just change my Head on the commit I merged the release.

    I then updated the library, made a new release.

    Finally go back to my Dev branch, fix some merge conflict from the previous Hotfix.

    An other solution would have been to not finish my Feature, keep the branch, then do the Hotfix on the Release and then finish the feature in order to merge it in the Dev branch without being a mess.