Text of llvm.org › docs › GitHub.html as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

LLVM GitHub User Guide - LLVM

Hide navigation sidebar Hide table of contents sidebar Back to top Edit this page Toggle table of contents sidebar LLVM GitHub User Guide # Introduction # The LLVM Project uses GitHub for Source Code , Releases , Issue Tracking ., and Code Reviews . This page describes how the LLVM Project users and developers can participate in the project using GitHub. Before your first PR # Please ensure that you have set a valid email address in your GitHub account, see Email Addresses .

Pull Requests # The LLVM project is using GitHub Pull Requests for Code Reviews. This document describes the typical workflow of creating a Pull Request and getting it reviewed and accepted. This is meant as an overview of the GitHub workflow, for complete documentation refer to GitHub’s documentation . Note If you are using a Pull Request for purposes other than review (eg: precommit CI results, convenient web-based reverts, etc) add the skip-precommit-approval label to the PR.

GitHub Tools # You can interact with GitHub in several ways: via git command line tools, the web browser, GitHub Desktop , or the GitHub CLI . This guide will cover the git command line tools and the GitHub CLI. Creating Pull Requests # Keep in mind that when creating a pull request, it should generally only contain one self-contained commit initially. This makes it easier for reviewers to understand the introduced changes and provide feedback.

It also helps maintain a clear and organized commit history for the project. If you have multiple changes you want to introduce, it’s recommended to create separate pull requests for each change. Create a local branch per commit you want to submit and then push that branch to your fork of the llvm-project and create a pull request from the fork . As GitHub uses the first line of the commit message truncated to 72 characters as the pull request title, you may have to edit to reword or to undo this truncation.

Creating Pull Requests with GitHub CLI # With the CLI it’s enough to create the branch locally and then run: gh pr create When prompted select to create and use your own fork and follow the instructions to add more information needed. Note When you let the GitHub CLI create a fork of llvm-project to your user, it will change the git “remotes” so that “origin” points to your fork and “upstream” points to the main llvm-project repository.

Updating Pull Requests # In order to update your pull request, the only thing you need to do is to push your new commits to the branch in your fork. That will automatically update the pull request. You can also use the Update Branch button in GitHub’s Pull Request UI, but be aware that it will create a merge commit on your branch. When updating a pull request, you should push additional “fix up” commits to your branch instead of force pushing.

This makes it easier for GitHub to track the context of previous review comments. Consider using the built-in support for fixups in git. If you create fix up or merge commits, you must squash and merge before landing the PR and you must use the pull request title and description as the commit message. You can do this manually with an interactive git rebase or with GitHub’s built-in tool. See the section about landing your fix below.

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.

If you want to make your pull request up-to-date with main, you might consider updating your branch, as described in the previous section. 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. Note This guide assumes that the PR branch only has 1 author.

If you are collaborating with others on a single branch, be careful how and when you push changes. --force-with-lease may be useful in this situation. Approvals # Before merging a PR you must have the required approvals. See LGTM - How a Patch Is Accepted for more details. Landing your change # After your PR is approved, ensure that: The PR title and description describe the final changes. These will be used as the title and message of the final squashed commit.

The titles and messages of commits in the PR will not be used. You have set a valid email address in your GitHub account, see Email Addresses . Note The LLVM Project monorepo on GitHub is configured to always use “Squash and Merge” as the pull request merge option when using the web interface. With this option, GitHub uses the PR summary as the default commit message. Users with write access who can merge PRs have a final opportunity to edit the commit title and message before merging.

However, this option is not available to contributors without write access. At this point, you can merge your changes. If you do not have write permissions for the repository, the merge button in GitHub’s web interface will be disabled. If this is the case, continue following the steps here but ask one of your reviewers to click the merge button on your behalf. To merge your PR into the LLVM main branch do one of the following: Use the button Squash and merge in GitHub’s web interface, if you do this remember to review the commit message when prompted.

Afterwards you can select the option Delete branch to delete the branch from your fork. Use the GitHub command line interface. Switch to your branch locally and run: gh pr merge --squash --delete-branch Specifying --squash automatically selects the desired “Squash and Merge” merge strategy. If you don’t specify --squash , you’ll get a selection option where you can only select “Squash and Merge”. Do not specify --rebase or --merge as these merge modes are not permitted in the LLVM repository.

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. If you need to resolve a merge conflict before merging, you can do it as follows: git fetch upstream git rebase upstream/main Then fix the source files causing merge conflicts and make sure to rebuild and retest the result.

Then: git add <files with resolved merge conflicts> git rebase --continue Finally, you’ll need to force push to your branch one more time before you can merge: git push --force This force push may ask if you intend to push hundreds, or potentially thousands of patches (depending on how long it’s been since your pull request was initially authored vs. when you intended to merge it). Since you’re pushing to a branch in your fork, this is ok and expected.

Github’s UI for the pull request will understand that you’re rebasing just your patches, and display this result correctly with a note that a force push did occur. After your force push, try merging your PR again following one of the above methods. Branches # It is possible to create branches in llvm/llvm-project/ that start with users/<username>/ , however this is intended to be able to support “stacked” pull-request.

Do not create any branches in the llvm/llvm-project repository otherwise, please use a fork (see above). User branches that aren’t associated with a pull-request will be deleted . Stacked Pull Requests # To separate related changes or to break down a larger PR into smaller, reviewable pieces, use “stacked pull requests” — this helps make the review process smoother. Note The LLVM Project monorepo on GitHub is config

The rest of this page is on the live site.