I have a git branch, dev
, that is exactly where I want my other git branch, master
to be.
master
has some hotfixes on it that are further in the future than the common ancestor of both so this command chain creates complicated and silly merge conflicts:
git checkout master
git merge dev # Complicated merge conflicts. Boo hiss.
What I would like to do is make a new commit on master that has the state of dev HEAD on it. From then on things can proceed in a more sane manner
Example:
dev: A ---> B ---> C ----> D
master: A ---> Y ---> Z ----> *
A is my common ancestor. Y and Z are conflicting hotfix changes, so the three-way merge between D, A, and Z is a mess.
In the end I want this result:
- HEAD of master contains the exact same code as the HEAD on dev
- History is not rewritten, since both branches have been pushed to remotes
- A nice commit message that explains this mergeish commit