Brainstorm's snippets (1/267)

  Github: Checking out pull requests locally

  • Find the ID number of the pull request. This is the sequence of digits right after the pull request's title.

  • Fetch the reference to the pull request based on its ID number, creating a new branch in the process:

    $ git fetch origin pull/ID/head:BRANCHNAME
    
  • Switch to the new branch that's based on this pull request:

    $ git checkout BRANCHNAME
    
  • At this point, you can do anything you want with this branch. You can run some local tests, or merge other branches into the branch.

When you're ready, you can push the new branch up:

$ git push origin BRANCHNAME

References: Modifying an inactive pull request locally