Manan's notes

Apply a GitHub PR as a patch to a repo

To apply a patch from a GitHub Pull Request (PR) to your local repository, you can follow these steps:

  1. Fetch the PR as a patch file:

    • Navigate to the Pull Request on GitHub.
    • Append .patch to the end of the PR URL. For example, if the PR URL is https://github.com/username/repo/pull/123, you would use https://github.com/username/repo/pull/123.patch.
    • Download the patch file from this URL.
  2. Apply the patch to your local repository:

    • Open your terminal.
    • Navigate to your local repository directory.
    • Use the git apply command to apply the patch. For example:
      git apply /path/to/your/downloaded/patchfile.patch