[llvm] [Docs] Update documentation for the new GitHub workflow (PR #65162)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 16:36:44 PDT 2023


================
@@ -46,11 +73,106 @@ The default commit message for a squashed pull request is the pull request
 description, so this will allow reviewers to review the commit message before
 approving the commit.
 
+When pushing to your branch, make sure you push to the correct fork. Check your
+remotes with:
+
+::
+
+  git remote -v
+
+And make sure you push to the remote that's pointing to your fork.
+
+Rebasing Pull Requests and Force Pushes
+---------------------------------------
+In general, you should avoid rebasing a Pull Request and force pushing to the
+branch that's the root of the Pull Request during the review. This action will
+make the context of the old changes and comments harder to find and read.
+
+Sometimes, a rebase might be needed to update your branch with a fix for a test
+or in some dependent code.
+
+After your PR is reviewed and accepted, you want to rebase your branch to ensure
+you won't encounter merge conflicts when landing the PR.
+
+Landing your change
+-------------------
+When your PR has been accepted you can use the web interface to land your change.
+The button that should be used is called `Squash and merge` and after you can
+select the option `Delete branch` to delete the branch from your fork.
+
+You can also merge via the CLI by switch to your branch locally and run:
+
+::
+
+  gh pr merge --squash --delete-branch
+
+
+Checking out another PR locally
+-------------------------------
+Sometimes you want to review another persons PR on your local machine to run
+tests or inspect code in your prefered editor. This is easily done with the
+CLI:
+
+::
+
+  gh pr checkout <PR Number>
+
+This is also possible with the web interface and the normal git command line
+tools, but the process is a bit more complicated. See GitHubs
+`documentation <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally?platform=linux&tool=webui#modifying-an-inactive-pull-request-locally>`_
+on the topic.
+
+Example Pull Request with GitHub CLI
+====================================
+Here is an example for creating a Pull Request with the GitHub CLI:
+
+::
+
+  # Clone the repo
+  gh repo clone llvm/llvm-project
+
+  # Switch to the repo and create a new branch
+  cd llvm-project
+  git switch -c my_change
+
+  # Create your changes
+  $EDITOR file.cpp
+
+  # Don't forget clang-format
+  git clang-format
+
+  # Commit, use a good commit message
+  git commit file.cpp
+
----------------
joker-eph wrote:

It is there after 6b6312b01d1f now

https://github.com/llvm/llvm-project/pull/65162


More information about the llvm-commits mailing list