feature
(protected) has conflicts with main
(protected) which I cannot resolve.
I have researched many solutions on and off SO and they all come back to a similar answer involving a third branch (fix
in this example).
My steps to resolve (intentionally verbose):
main
from feature
git switch -c fix origin/feature --no-track
git checkout main && git pull
git checkout fix
git merge main
git add .
, git commit
etcfeature
main
from feature
I tried this on a new (public) repo I created and it worked fine. But on my work project repo it does not and I cannot fathom why.
EDIT:
I have since tried git rebase main
at step 5 instead and worked through the conflicts, but the end result on the PR at step 8 was no different.
Check that the PR is being merged
not squashed
to retain the history.
In step 7 I was squashing which was ruining the history.