# Source: https://graphite-58cc94ce.mintlify.dev/docs/vs-code-extension-first-stack.md

> **Documentation Index**
> Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/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" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=280&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=df703809bef367ac725f870dd420692d 280w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=560&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=8f7062e816c569c4a0a8d9a01d929745 560w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=840&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=9e9a66a86492d6bb1fb4a2751bd8ffd4 840w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=1100&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=3ee8a8493e39757e897d6b635832f849 1100w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=1650&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=03a3edeff940b53c266d66d001a38662 1650w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=2500&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=e0b8685fa9ad905dcca4f68a7342698c 2500w" />

## 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" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=280&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=df703809bef367ac725f870dd420692d 280w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=560&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=8f7062e816c569c4a0a8d9a01d929745 560w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=840&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=9e9a66a86492d6bb1fb4a2751bd8ffd4 840w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=1100&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=3ee8a8493e39757e897d6b635832f849 1100w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=1650&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=03a3edeff940b53c266d66d001a38662 1650w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/86d2617d-1708222363-screenshot-2024-02-17-at-8-58-37-pm.png?w=2500&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=e0b8685fa9ad905dcca4f68a7342698c 2500w" />

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" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png?w=280&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=ff330f3f23763e56f827111d5b759cc7 280w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png?w=560&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=07b8e216dc5555ed3e626dcd491ef5c4 560w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png?w=840&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=439b9d4c0f0d449660dff132d0fc3160 840w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png?w=1100&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=a701de5869f8fb3a7836455e22faafad 1100w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png?w=1650&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=f284555f1451da8ee0d5e75ae29fed8c 1650w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/0252bb51-1708223343-screenshot-2024-02-17-at-8-59-01-pm.png?w=2500&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=a8eeca2d64d0b175e0b1221ea7ef1ecd 2500w" />

## 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" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png?w=280&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=c94a2d772e4373742e7736350fe9233a 280w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png?w=560&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=1bd5032208e75f44dd794f88d7bd01da 560w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png?w=840&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=4a8d839d0860a2410902ac31ed519a24 840w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png?w=1100&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=d6a1eaffb92a37701c34da464d7f9a3a 1100w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png?w=1650&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=d730f9de4d12c3bb779e0c1c9af3f98e 1650w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/97450653-1708223392-screenshot-2024-02-17-at-8-59-06-pm.png?w=2500&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=b564358ca31a0c4637670b913baa5d34 2500w" />

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" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png?w=280&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=71817e8cfa196ff02d49d3c1d5e84ca0 280w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png?w=560&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=a14892499cfba5c090b0203125f70fcd 560w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png?w=840&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=72081bef23be1b4ab10a66712b38af61 840w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png?w=1100&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=1cfc8e6b1417257f74b86642e29d55c8 1100w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png?w=1650&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=676db73426cf17287919754dbe5c1412 1650w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/3cefbd87-1708223406-screenshot-2024-02-17-at-8-59-12-pm.png?w=2500&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=4fc1c3454d28bf44c03ecfb89e04a010 2500w" />

## 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" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png?w=280&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=a7bf2ad772a02b0017110ff6b44fdfe3 280w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png?w=560&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=602f00ef1456ba79fb31fc1efa8f9061 560w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png?w=840&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=c1fb7c550396c9f7bf26efd0da1b9fdc 840w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png?w=1100&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=c8033838caa5df4596707239655d84f8 1100w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png?w=1650&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=de345cbda3891ae8a9e2ca370dad27c0 1650w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/144e344f-1708223423-screenshot-2024-02-17-at-8-59-23-pm.png?w=2500&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=82b93c387d5b46466df4b96367c53356 2500w" />

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