# Source: https://graphite-58cc94ce.mintlify.dev/docs/vs-code-extension-first-pr.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 A Pull Request

> Learn to use the Graphite VS Code extension to create a single pull request.

## Prerequisites

Open VS Code in a repository where you're comfortable making changes. Once you've [installed the Graphite VS Code extension](https://marketplace.visualstudio.com/items?itemName=Graphite.gti-vscode), there will be a Graphite icon on the far left of VS Code.

<img src="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/95bfb7b8-1708221593-screenshot-2024-02-17-at-8-53-28-pm.png?fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=fcc0976d25759fda14bdb7a9e774a6d4" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/95bfb7b8-1708221593-screenshot-2024-02-17-at-8-53-28-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/95bfb7b8-1708221593-screenshot-2024-02-17-at-8-53-28-pm.png?w=280&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=7f13445eaf593978fe87527b7a7d94ee 280w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/95bfb7b8-1708221593-screenshot-2024-02-17-at-8-53-28-pm.png?w=560&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=ebe1349b48252bc7a0212f6d1b736c55 560w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/95bfb7b8-1708221593-screenshot-2024-02-17-at-8-53-28-pm.png?w=840&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=556601dd422799947dc9c1189fe0c99b 840w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/95bfb7b8-1708221593-screenshot-2024-02-17-at-8-53-28-pm.png?w=1100&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=cdd6e8a1e05ac57228f740f4cd2950a1 1100w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/95bfb7b8-1708221593-screenshot-2024-02-17-at-8-53-28-pm.png?w=1650&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=1b657715463c804468fc25c3271c6cd8 1650w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/95bfb7b8-1708221593-screenshot-2024-02-17-at-8-53-28-pm.png?w=2500&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=74a321d510c06fe682c171a7849e78a4 2500w" />

When you click the Graphite icon in the left rail, you'll be asked to configure Graphite if you never have before. Follow the prompts in the extension to set it up.

Once you configure Graphite, you'll see all of the branches in your repository as a tree: for example, in the below example, main has two directly descendent child branches ("Feature A" and "Feature B").

<img src="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/da577c6d-1708221624-screenshot-2024-02-17-at-8-57-21-pm.png?fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=be8e037de313853696abd0a2763a46e2" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/da577c6d-1708221624-screenshot-2024-02-17-at-8-57-21-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/da577c6d-1708221624-screenshot-2024-02-17-at-8-57-21-pm.png?w=280&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=f07bf0aed1da72181c0d6bf1e99198f9 280w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/da577c6d-1708221624-screenshot-2024-02-17-at-8-57-21-pm.png?w=560&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=34a3ad1ac4bca3c8ea4ff394de6e98e8 560w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/da577c6d-1708221624-screenshot-2024-02-17-at-8-57-21-pm.png?w=840&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=89c132ff083e2ded6137b4d86c688e17 840w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/da577c6d-1708221624-screenshot-2024-02-17-at-8-57-21-pm.png?w=1100&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=98dae1f89bd32bab0bb4c6f075760f32 1100w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/da577c6d-1708221624-screenshot-2024-02-17-at-8-57-21-pm.png?w=1650&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=2cb86a22edc2fd628b8b6113210c63ef 1650w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/da577c6d-1708221624-screenshot-2024-02-17-at-8-57-21-pm.png?w=2500&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=5227efb213168ae320a0764b22cb7505 2500w" />

Make sure you do not have uncommitted changes in your repository (these will show up as a yellow "uncommitted changes" branch in the Graphite extension). If you do have uncommitted changes, either commit them to a branch or delete them using whatever tools you usually use to work with Git repos before continuing.

## Checkout main

The VS Code extension will show the branch you currently have checked out with a triangle next to the branch name. If you have a branch other than your trunk branch (usually named `main` or `master`) checked out, click on trunk and press checkout to change the branch you have.

<img src="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/a5851193-1708221770-screenshot-2024-02-17-at-8-57-25-pm.png?fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=665106ca489738bf9b75e83e700d1d52" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/a5851193-1708221770-screenshot-2024-02-17-at-8-57-25-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/a5851193-1708221770-screenshot-2024-02-17-at-8-57-25-pm.png?w=280&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=8e06b68fabaf2f5bc8d9e69249567a78 280w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/a5851193-1708221770-screenshot-2024-02-17-at-8-57-25-pm.png?w=560&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=00182332d04e85721617dad7e626276f 560w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/a5851193-1708221770-screenshot-2024-02-17-at-8-57-25-pm.png?w=840&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=117038b5f6d22a9878aacdbb5c4cf043 840w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/a5851193-1708221770-screenshot-2024-02-17-at-8-57-25-pm.png?w=1100&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=3389c3d0d70a5903de8699d2671820ed 1100w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/a5851193-1708221770-screenshot-2024-02-17-at-8-57-25-pm.png?w=1650&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=1bd00c48f69c3e9d4010340449b1d43b 1650w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/a5851193-1708221770-screenshot-2024-02-17-at-8-57-25-pm.png?w=2500&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=161ee4e303622257e2c83c9f111c4b1b 2500w" />

## Make changes

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/vY1t0Vsr-LRJgMIn/images/30a7fe74-1708221908-screenshot-2024-02-17-at-8-57-39-pm.png?fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=47c8c149e842df35f2910b9206aa7261" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/30a7fe74-1708221908-screenshot-2024-02-17-at-8-57-39-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/30a7fe74-1708221908-screenshot-2024-02-17-at-8-57-39-pm.png?w=280&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=f7a03d2082c7fdbcf7e9fc45d9cb5d22 280w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/30a7fe74-1708221908-screenshot-2024-02-17-at-8-57-39-pm.png?w=560&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=7bd47a06914638f356fbffb3b665178f 560w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/30a7fe74-1708221908-screenshot-2024-02-17-at-8-57-39-pm.png?w=840&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=b5b4a76897fad20a24547b8077079279 840w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/30a7fe74-1708221908-screenshot-2024-02-17-at-8-57-39-pm.png?w=1100&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=6e57e23c5844ed13281660b5e362ce85 1100w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/30a7fe74-1708221908-screenshot-2024-02-17-at-8-57-39-pm.png?w=1650&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=760e03facd3cfb39a6270dd53f0c1d5e 1650w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/30a7fe74-1708221908-screenshot-2024-02-17-at-8-57-39-pm.png?w=2500&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=4e17288fbf24058b48bee90459e509e6 2500w" />

## Stage your changes

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/050fa24a-1708221987-screenshot-2024-02-17-at-8-57-42-pm.png?fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=7f254218a0c8fd29cf66e06f9c11de8d" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/050fa24a-1708221987-screenshot-2024-02-17-at-8-57-42-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/050fa24a-1708221987-screenshot-2024-02-17-at-8-57-42-pm.png?w=280&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=00caa0351aa4dab98a031e07b58003ea 280w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/050fa24a-1708221987-screenshot-2024-02-17-at-8-57-42-pm.png?w=560&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=2b0b58d4e06ec54d4281d8816e969a47 560w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/050fa24a-1708221987-screenshot-2024-02-17-at-8-57-42-pm.png?w=840&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=56a50fc7a328e12a2b93595b86817c3f 840w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/050fa24a-1708221987-screenshot-2024-02-17-at-8-57-42-pm.png?w=1100&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=8915232fda9db8f61b4a874ab1ad1286 1100w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/050fa24a-1708221987-screenshot-2024-02-17-at-8-57-42-pm.png?w=1650&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=83b5d4dd63908c05b24969cb858a06eb 1650w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/050fa24a-1708221987-screenshot-2024-02-17-at-8-57-42-pm.png?w=2500&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=71792646b1527002f15873603a186fd0 2500w" />

## Create a branch

Once you've staged changes, you can create a new branch by entering a commit title and pressing create branch.

<img src="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/ec8e0860-1708222058-screenshot-2024-02-17-at-8-57-47-pm.png?fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=914c893cbd14dbfcdb9cd18c480d2dc5" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/ec8e0860-1708222058-screenshot-2024-02-17-at-8-57-47-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/ec8e0860-1708222058-screenshot-2024-02-17-at-8-57-47-pm.png?w=280&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=8622afe9daecee143e028f3455be5fb8 280w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/ec8e0860-1708222058-screenshot-2024-02-17-at-8-57-47-pm.png?w=560&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=c556ea74b347afb3b7bd98461bb7c3b0 560w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/ec8e0860-1708222058-screenshot-2024-02-17-at-8-57-47-pm.png?w=840&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=0a1826e0324fe889ac20f7bd76b8c5c3 840w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/ec8e0860-1708222058-screenshot-2024-02-17-at-8-57-47-pm.png?w=1100&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=73ac64a9ee5b49ac959bc47f1adef361 1100w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/ec8e0860-1708222058-screenshot-2024-02-17-at-8-57-47-pm.png?w=1650&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=e5390604e006f30e49db7453fd862f8a 1650w, https://mintcdn.com/graphite-58cc94ce/v5snjlX4njZhFyeg/images/ec8e0860-1708222058-screenshot-2024-02-17-at-8-57-47-pm.png?w=2500&fit=max&auto=format&n=v5snjlX4njZhFyeg&q=85&s=be6e5dade00f6b64a8bea77851bccca3 2500w" />

Your new branch should now show up in the tree as checked out:

<img src="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/376cd6fb-1708222250-screenshot-2024-02-17-at-8-57-50-pm.png?fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=f157359092b649bbd404dd4cde6fde57" data-og-width="2272" width="2272" data-og-height="1760" height="1760" data-path="images/376cd6fb-1708222250-screenshot-2024-02-17-at-8-57-50-pm.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/376cd6fb-1708222250-screenshot-2024-02-17-at-8-57-50-pm.png?w=280&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=4ed810c8d08e7869a70ceb783e913b49 280w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/376cd6fb-1708222250-screenshot-2024-02-17-at-8-57-50-pm.png?w=560&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=86f7f04a4a7e0399cf2181d7fff350d6 560w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/376cd6fb-1708222250-screenshot-2024-02-17-at-8-57-50-pm.png?w=840&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=da9163eed5ea166f27f980dda6283f4e 840w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/376cd6fb-1708222250-screenshot-2024-02-17-at-8-57-50-pm.png?w=1100&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=8417e1f2000f9b9d0966ca942a68d720 1100w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/376cd6fb-1708222250-screenshot-2024-02-17-at-8-57-50-pm.png?w=1650&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=fa081580866c07f4695b317070c7ce64 1650w, https://mintcdn.com/graphite-58cc94ce/vY1t0Vsr-LRJgMIn/images/376cd6fb-1708222250-screenshot-2024-02-17-at-8-57-50-pm.png?w=2500&fit=max&auto=format&n=vY1t0Vsr-LRJgMIn&q=85&s=74bd152a9004e5af3e37902960572d26 2500w" />

## Submit your branch

Assuming your repository is connected to a remote, you should see a "Sync" button in the top left of the extension pane and an upload button next to any branches that don't yet have a PR opened for them.

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/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" />

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