---
title: Testing a Pull Request Locally
description: If you want to test a pull request locally, here are a few simple commands to get setup.
date: 2020-08-28
tags: GIT, Pull Requests, Code Review
source: https://brianchildress.co/blog/testing-pull-request-locally
---

# Testing a Pull Request Locally

Make a temporary directory (optional)

```sh
mkdir <temp folder> && cd <temp folder>
```

_Initialize the folder with a .git repo_ (optional)

```sh
git init
```

_Fetch the pull request, creating a new branch_

```sh
git fetch <git remote url> pull/<pull request ID>/head:<new local branch name>
```

_Checkout new branch_

```
git checkout <new local branch name>
```

Now with the pull request code you can do local testing, see the changes in the context of the rest of the application code, run the application locally, etc.
