> ## Documentation Index
> Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create PRs For A Stack

> Learn to use the Graphite VS Code extension to create pull requests for a stack.

## Prerequisites

Complete the [Create a pull request](/vs-code-extension-first-pr) guide, and make sure you've:

* Checked out your first PR

* Don't have any uncommitted changes

  <img src="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=1cea038e7874fdc25f8714a83d3256a2" width="2272" height="1760" data-path="images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png" />

## Stacking

The goal of this guide is to teach you how to [stack](https://stacking.dev/) with the Graphite VS Code extension.

Stacking is a technique to continue developing while you wait for review on PRs. A stacked branch is a branch that is created on top of another branch that is still waiting for review. As that previous branch is updated and ultimately merged into main, Graphite will incorporate those changes into any dependent branches.

If this is confusing now, don't worry - it becomes clearer as you do it.

## Make and stage changes

Like in the earlier guide, make changes to your repository, either by adding a file or editing an existing file. That file should now show up under "uncommitted changes" in the extension.

<img src="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=1cea038e7874fdc25f8714a83d3256a2" width="2272" height="1760" data-path="images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png" />

Select uncommitted changes, and you'll see all the changed files in your repository (files added, files modified, and files deleted). Clicking the checkbox next to a file allows you to stage it in git (the equivalent of running `git add`).

<img src="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png?fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=22fd3e20ce6fa230d80484a895739239" width="2272" height="1760" data-path="images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png" />

## Create a branch

Once you've staged changes, you can either modify the existing branch or create a new stacked branch. Enter a commit title and pressing create branch.

<img src="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png?fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=760fb20f3548f5767492790e842e3537" width="2272" height="1760" data-path="images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png" />

Your new branch should now show up in the tree as checked out and *stacked* on top of the first:

<img src="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png?fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=569adfec1c8f81f2b43a2657e33d76b7" width="2272" height="1760" data-path="images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png" />

## Submit your branch

Like the first guide, click the upload button next to your first PR to open a draft PR. After opening the PR, there will be a circle next to the branch showing the PR's status (in this case it's open).

<img src="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png?fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=2db0d108763fe7200998ff519eaf0078" width="2272" height="1760" data-path="images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png" />

That's it - you just created your first stack using the Graphite VS Code extension!
