Changing the Origin of your Branch
2022-11-30
Today I learned that you can change the origin of your branch in Git.
Use Case
the Developer was meant to create a bug branch off of a specific patch branch, but did it off of the next minor release.
The concern here is that the Pull Request for the bug branch will contain everything from the Release at the point of branch off which may contain breaking changes.
The Resolution is to rebase the bug branch with the Patch branch changing the origin and thus removing the commits from the Release branch.
git rebase --onto newBase oldBase feature/branch