[llvm] [Docs][Github] explain how to rectify gh pr merge failure (PR #66223)
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 13 09:01:35 PDT 2023
================
@@ -131,6 +131,33 @@ You can also merge via the CLI by switching to your branch locally and run:
gh pr merge --squash --delete-branch
+If you observe an error message from the above informing you that your pull
+request is not mergeable, then that is likely because upstream has been
+modified since your pull request was authored in a way that now results in a
+merge conflict. You must first resolve this merge conflict in order to merge
+your pull request. In order to do that:
+
+::
+
+ git fetch origin
+ git rebase origin/main
+
+Then fix the source files causing merge conflicts.
+
+::
+
+ git add <files with resolved merge conflicts>
+ <rebuild + retest>
+ git rebase --continue
+
+Finally, you'll need to force push to your branch one more time before you can
+merge:
+
+::
+
+ git push -f
----------------
nickdesaulniers wrote:
It's probably worth noting that this may ask you to push potentially hundreds or thousands of patches.
Example.
```
Are you sure you want to push 248 commits? (y/N): y
```
This is fine, since you're pushing to your private branch. The results can be seen at the bottom of https://github.com/llvm/llvm-project/pull/66003; only my 3 rebased commits are listed, not all 248 commits since I initially authored that PR.
https://github.com/llvm/llvm-project/pull/66223
More information about the llvm-commits
mailing list