> ## Documentation Index
> Fetch the complete documentation index at: https://docs.requestly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stage and commit changes

> Read the Git change list in the Requestly sidebar, stage or discard files by request or by collection, and record a commit without leaving the app.

Every edit you make to a collection, a request, or an environment in a local project writes a file. The **Git** panel lists those files, lets you choose which ones go into the next commit, and records the commit for you. Git applies to [local projects](/api-client/git/overview#requirements) only, so the **Git** tab is hidden while a team project is active.

<Info>
  Git requires the **desktop app**. [Download Requestly](https://requestly.com/downloads).
</Info>

## Read the change list

Open the **Git** tab. When the working tree holds changes, the panel shows the commit box, then up to two collapsible sections.

* **Changes (N)** lists the files you have edited but not staged.
* **Staged (N)** lists the files that will go into the next commit.

Each header carries one bulk action. **Changes** has **Stage all**, and **Staged** has **Unstage all**. A section appears only when it holds at least one file, so a fully staged tree shows **Staged** alone.

The API Client sidebar also shows a badge on the **Git** tab icon. It counts every changed file in the project, staged and unstaged together.

<Frame>
  <img src="https://mintcdn.com/requestly/eF9SdqtaJHfrCNE2/images/git-panel-dirty.light.png?fit=max&auto=format&n=eF9SdqtaJHfrCNE2&q=85&s=79694e550a00ff83447a095d1ccfea5e" alt="The Git panel with a typed commit message, a Staged section of seven files, and a Changes section of sixty-three files" className="dark:hidden" width="1280" height="800" data-path="images/git-panel-dirty.light.png" />

  <img src="https://mintcdn.com/requestly/eF9SdqtaJHfrCNE2/images/git-panel-dirty.dark.png?fit=max&auto=format&n=eF9SdqtaJHfrCNE2&q=85&s=2d2a1e40ec83b5db584fabe17b4b050b" alt="The Git panel with a typed commit message, a Staged section of seven files, and a Changes section of sixty-three files" className="hidden dark:block" width="1280" height="800" data-path="images/git-panel-dirty.dark.png" />
</Frame>

### The change tree

Files are not a flat list. Requestly groups them the way you already think about them: a collection holds requests, and a request holds the files that store it. Expand a collection to see its requests, and expand a request to see its files. Files that live outside the collections folder, such as the project's own configuration, sit as their own rows at the top level of the tree, not inside a group.

<Tip>
  Stage, unstage, and discard work at every level. Acting on a request folder covers every changed file inside it, so you can stage a whole request in one click.
</Tip>

Hover a file row to reveal its actions. Collection and request rows keep their actions visible, so a whole group is always one click away.

<Frame>
  <img src="https://mintcdn.com/requestly/K-Ztz5uJVTElPvBt/images/git-change-tree.light.png?fit=max&auto=format&n=K-Ztz5uJVTElPvBt&q=85&s=e4678ad0451321a697412603ea2f0bbb" alt="The Changes section grouped as a tree, with the Pets and Store collections holding requests, each request holding its files, and stage and discard icons on a hovered row" className="dark:hidden" width="1280" height="800" data-path="images/git-change-tree.light.png" />

  <img src="https://mintcdn.com/requestly/K-Ztz5uJVTElPvBt/images/git-change-tree.dark.png?fit=max&auto=format&n=K-Ztz5uJVTElPvBt&q=85&s=0b87ba52c46fb6c8cf2eeb5f858b3e5e" alt="The Changes section grouped as a tree, with the Pets and Store collections holding requests, each request holding its files, and stage and discard icons on a hovered row" className="hidden dark:block" width="1280" height="800" data-path="images/git-change-tree.dark.png" />
</Frame>

| Action     | Where it appears | What it does                                                    |
| ---------- | ---------------- | --------------------------------------------------------------- |
| Plus icon  | **Changes** rows | Stages the file, request, or collection.                        |
| Minus icon | **Staged** rows  | Unstages it again.                                              |
| Undo arrow | **Changes** rows | Discards the change. See [Discard a change](#discard-a-change). |

<Warning>
  Discarding a file Git has never tracked **deletes it from disk**, because there is no earlier version to restore.
</Warning>

Click a file name to open its [diff](/api-client/git/history-and-diffs#open-a-diff) in a tab. From **Changes** the diff compares your working copy against what is staged. From **Staged** it compares what is staged against the last commit.

### Status letters

A letter at the right of each file row states what changed. The letters are close to `git status --short`, with one difference: a file Git has never tracked reads as `U` here rather than `??`.

| Letter | Meaning                               |
| ------ | ------------------------------------- |
| `M`    | Modified                              |
| `A`    | Added                                 |
| `D`    | Deleted                               |
| `R`    | Renamed                               |
| `U`    | Untracked, or unmerged during a merge |

A file that a merge left conflicted also carries a **conflict** badge next to its letter. See [Resolve merge conflicts](/api-client/git/resolve-conflicts).

## Discard a change

Discarding throws away work that is not committed, and Git cannot bring it back.

<Steps>
  <Step title="Click the undo arrow">
    Find the file, request, or collection in **Changes** and click its undo arrow.
  </Step>

  <Step title="Read the confirmation">
    A dialog opens, headed **Discard changes to `<name>`?**. For a single file it warns "This permanently discards your uncommitted changes to this file. It can't be undone." For a request or a collection it names the number of files instead, so you can see how wide the discard reaches.

    <Frame>
      <img src="https://mintcdn.com/requestly/K-Ztz5uJVTElPvBt/images/git-discard-confirm.light.png?fit=max&auto=format&n=K-Ztz5uJVTElPvBt&q=85&s=a43534347a8d501e5fef9f76133abe8e" alt="The Discard changes confirmation dialog for the List pets request, warning that it discards uncommitted changes to three files, with Cancel and Discard buttons" className="dark:hidden" width="1280" height="800" data-path="images/git-discard-confirm.light.png" />

      <img src="https://mintcdn.com/requestly/K-Ztz5uJVTElPvBt/images/git-discard-confirm.dark.png?fit=max&auto=format&n=K-Ztz5uJVTElPvBt&q=85&s=e7a33bea332b3d4ea538b2c3889fc258" alt="The Discard changes confirmation dialog for the List pets request, warning that it discards uncommitted changes to three files, with Cancel and Discard buttons" className="hidden dark:block" width="1280" height="800" data-path="images/git-discard-confirm.dark.png" />
    </Frame>
  </Step>

  <Step title="Confirm">
    Click **Discard** to throw the changes away, or **Cancel** to keep them.
  </Step>
</Steps>

<Warning>
  Discarding a request or a collection discards every changed file inside it. Check the file count in the dialog before you confirm.
</Warning>

## Write a commit

<Steps>
  <Step title="Stage what belongs in the commit">
    Stage individual files, or click **Stage all** on the **Changes** header. Staged files move to the **Staged** section.
  </Step>

  <Step title="Describe the change">
    Type a message in the **Commit message** box at the top of the panel. The box grows as you type.
  </Step>

  <Step title="Commit">
    Click **Commit changes**. Requestly records the commit on the current branch and clears the message box.
  </Step>
</Steps>

If you click **Commit changes** with nothing staged, Requestly warns "No staged changes to commit. Stage a file first." and records nothing. Git refuses an empty commit, so stage at least one file first.

Once the working tree is clean, the panel shows **Working tree clean** with the note "All changes are committed. New edits to collections, environments, and requests show up here to stage and commit."

## Next steps

<CardGroup cols={2}>
  <Card title="Push and pull" icon="arrows-rotate" href="/api-client/git/push-and-pull">
    Send your commits to the remote and bring your teammates' work in.
  </Card>

  <Card title="Git overview" icon="code-branch" href="/api-client/git/overview">
    The panel states, the sidebar status bar, and the messages Requestly shows.
  </Card>
</CardGroup>
