How to fix Merge Conflicts
Conflicts on a Pull Request
Section titled “Conflicts on a Pull Request”Conflicts can arise because many contributors work on the repository, and changes can break your PR which is pending a review and merge.
Since we squash all commits, you may not need to do a rebase. However, if a rebase is requested, follow these steps to rebase your PR branch onto main:
-
Rebase your local copy:
Terminal window git checkout <pr-branch>git pull --rebase upstream main -
If the rebase stops because of conflicts, edit the affected files to resolve them and remove the conflict markers. Stage each resolved file and continue the rebase:
Terminal window git add <resolved-file>git rebase --continueRepeat this step if Git encounters more conflicts, until the rebase completes.
-
Push back your changes to the PR
Terminal window git push --force origin <pr-branch>