Sometimes you have a pretty old branch you are trying to merge into and you are absolutely sure what you have is what you want, and therefore you don't want to deal with any sort of merge conflicts, you would rather just tell git to use my version and move on.
The first step is to make sure your local copy of the branch you are moving into is up to date.
git checkout main git pull
It's also worth updating your feature branch before doing the merge. Maybe you have teammates that have updated the repo, or you popped in a quick change from the web ui. It's simple and worth checking.
git checkout my-feature git pull
Merge the changes from main into
git merge main
Now is where the merge conflict may have started. If you are completely sure
that your copy is correct you can
, if you are completely sure that
is correct, you can
git checkout --ours . git merge --continue
This will pop open your configured
. If you have
not configured your editor, it will default to vim. Close vim with
, accepting the
Now push your changes that do not clash with main and finish your pr.