> ## 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](https://docs.requestly.com/api-client/git/overview.md#requirements) only, so the **Git** tab is hidden while a team project is active.

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

## 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.

![The Git panel with a typed commit message, a Staged section of seven files, and a Changes section of sixty-three files](https://mintcdn.com/requestly/eF9SdqtaJHfrCNE2/images/git-panel-dirty.light.png?fit=max\&auto=format\&n=eF9SdqtaJHfrCNE2\&q=85\&s=79694e550a00ff83447a095d1ccfea5e)

### 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.

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.

![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](https://mintcdn.com/requestly/K-Ztz5uJVTElPvBt/images/git-change-tree.light.png?fit=max\&auto=format\&n=K-Ztz5uJVTElPvBt\&q=85\&s=e4678ad0451321a697412603ea2f0bbb)

| 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.

Click a file name to open its [diff](https://docs.requestly.com/api-client/git/history-and-diffs.md#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](https://docs.requestly.com/api-client/git/resolve-conflicts.md).

## Discard a change

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

**1. Click the undo arrow**

Find the file, request, or collection in **Changes** and click its undo arrow.

**2. 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.

![The Discard changes confirmation dialog for the List pets request, warning that it discards uncommitted changes to three files, with Cancel and Discard buttons](https://mintcdn.com/requestly/K-Ztz5uJVTElPvBt/images/git-discard-confirm.light.png?fit=max\&auto=format\&n=K-Ztz5uJVTElPvBt\&q=85\&s=a43534347a8d501e5fef9f76133abe8e)

**3. Confirm**

Click **Discard** to throw the changes away, or **Cancel** to keep them.

> [!WARNING]
>
> Discarding a request or a collection discards every changed file inside it. Check the file count in the dialog before you confirm.

## Write a commit

**1. Stage what belongs in the commit**

Stage individual files, or click **Stage all** on the **Changes** header. Staged files move to the **Staged** section.

**2. Describe the change**

Type a message in the **Commit message** box at the top of the panel. The box grows as you type.

**3. Commit**

Click **Commit changes**. Requestly records the commit on the current branch and clears the message box.

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

> [card] [Push and pull](https://docs.requestly.com/api-client/git/push-and-pull.md)
>
> Send your commits to the remote and bring your teammates' work in.

> [card] [Git overview](https://docs.requestly.com/api-client/git/overview.md)
>
> The panel states, the sidebar status bar, and the messages Requestly shows.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.