# Changes

Review what your agents changed, file by file, then their commits, branches, worktrees, pull requests and issues.

An agent has been busy for twenty minutes and says it's done. Before you commit anything, you want to
see what it actually touched, and **Changes** shows you: every file that differs from the last commit,
each with its diff, right beside the agent that made it. The same panel holds the project's pull
requests and issues on GitHub. Looking never stages, commits, checks out or fetches, so you can open it
as often as you like. Changes writes to your project only when you press **Commit**, and sends to
GitHub only a comment or change you click in Pull requests or Issues.

## Open Changes

Hover the project's header in the sidebar and choose **Changes**. You'll see it once the project's
folder is in a git checkout and git 2.36 or later is installed; on a Mac without the Xcode Command
Line Tools, Rundesk uses any other git on your `PATH`, such as Homebrew's.

Changes takes the place of the project's rows in the sidebar, the way the project's Files panel
does ([Files & Docs](/docs/docs-view.md)), and it has five tabs:

| Tab | Contents |
|---|---|
| **Changes** | every file that differs from the last commit, staged or not, with the count |
| **History** | the branch's commits, newest first, with `↑3 ↓1` for the commits to push and to pull |
| **Compare** | everything the branch would bring into another branch, as its pull request would show it |
| **Pull requests** | the repository's pull requests on GitHub, each with its conversation, files and checks |
| **Issues** | the repository's issues on GitHub, to read, file, comment on and close, or to hand to an agent |

In a repository with no other branch, Compare says `Nothing to compare: this repository has no other branch.`

## Review changed files

Each file shows its path and a colored mark for what happened to it: amber for modified, green for
added, red for deleted, blue for renamed, and orange for a merge conflict. When the list is long, type
in `Filter 12 changed files`, or use the filter button at the end of the field to hide a file type.

1. Click a file, and its diff opens in a tab beside your agents, named such as `App.tsx (changes)`.
2. Press ↑ and ↓ to walk the list; the diff follows along.
3. Double-click a file when you want it whole, as it is now.

The diff shows each changed line with three lines around it, and marks the words that changed inside
a line, so a one-word fix doesn't hide in a long line. The cog on the diff's path row, **Diff
settings**, switches between `Unified` and `Split`, and `Show whole file` opens every line. A markdown
file reads best as a page: choose `View formatted` and you'll see the new version with added
paragraphs in green and removed ones struck through in red. A changed image shows its two versions
side by side.

Leave Changes open while an agent works. The list and the diff are read again every two seconds, so
you watch its edits land as it makes them.

## Commit your changes

When the work looks right, commit it from the bottom of the Changes tab, as you would in GitHub Desktop.
Every changed file has a checkbox, selected to start with; deselect the ones to leave out, or use the
box at the start of the filter field to select or deselect every file shown.

1. Write a **Summary**, the commit's first line. **Description** is optional.
2. Press **Commit 3 files to main** (it counts the files you selected and names your branch), or ⌘Enter
   in either field.

Only the selected files go in, as they are on disk, under your own git name and email, and anything else
you staged in a terminal stays staged. Your repository's hooks run, so a pre-commit check can still stop
the commit: then its message appears under the button and your summary and selections stay as they were.
A selected file the filter hides is still committed, and the line under the button says how many are
hidden.
The list and History update at once, and nothing is pushed.

While the button can't commit, hover it to see why: no file selected, no summary, a merge conflict to
resolve, or no branch checked out. A merge or rebase in progress is finished in a terminal. Changes
commits in a worktree the same way, to that worktree's branch.

## Throw away a change

To put a file back the way it was at the last commit, right-click it in the Changes list and pick
**Discard changes**. It's handy for an agent's edit you don't want, or a file you only tried something
in. A modified file gets its committed content back, a deleted file returns, and a renamed file gets
its old name back, the file under its new name going to the Trash. A new file that was never committed
goes to the Trash, so you can still fish it out of there.

To discard several files at once, ⌘-click them (Ctrl-click on Windows), or Shift-click to pick a run
of them, then right-click one of them. Rundesk always asks first, naming the file, or saying how many,
because the changes can't be brought back. Anything you staged in a terminal for those files goes too;
every other file stays as it was, and a message confirms what was discarded. While a merge or rebase is under way, or a conflict is unresolved,
finish that in a terminal first. Whenever a discard, an undo or a reverse can't go ahead, a dialog says
why, with an **OK** to close it; if a discard stops partway, it also says what was already done. If you renamed a file and then made a new file under its old name,
discard that new file first, so the old name has room to come back. It works in a worktree's Changes view the same way.

## Undo or reverse a commit

Committed too soon? Right-click your latest commit in the **History** tab and pick **Undo commit**,
as long as it isn't pushed yet, as far as Rundesk knows from your last fetch. Your branch goes back one commit, and everything that was in it is
still in your files, staged and ready to commit again. The commit isn't gone for good either: for
about 30 days, `git reflog` in a terminal can bring it back, even if you discard its changes.

For any other commit, including one you've already pushed, pick **Reverse changes**. Rundesk adds a
new commit that undoes it, so the history others have stays as it is. Both ask first, neither
pushes anything, and a message confirms each once it's done.

A reverse is all or nothing. If later changes touch the same lines, Rundesk says it can't reverse it
automatically and leaves everything exactly as it was. It also waits while a file the reverse would change
has changes you haven't committed, or while anything is staged: commit those first. And it never
writes over a file you have that isn't in the repository, such as an ignored log at the same path: it
names the file for you to move first. In a project that's one folder of a larger repository, a commit
that also changed files outside that folder is reversed from a project at the repository's top
instead, as Rundesk only writes inside the project you chose. Merge commits, and a repository's very
first commit, can't be reversed here, and reversing needs git 2.40 or newer. If later commits renamed
the files, the reverse follows them to their new names. If a later commit already took a commit's
changes back, Rundesk tells you there's nothing left to reverse.

## Read commits and history

Once the work is committed, the **History** tab lists its commits. Each commit shows its first line,
its author and how long ago it was made, and the ones no remote branch holds yet carry an arrow,
`Not pushed` on hover, so you can see exactly what a push would send. Click a commit for its message
and the files it changed, each with its diff. `Filter commits` searches the whole history, by
message, author, file or hash.

## Compare branches

About to open a pull request? The **Compare** tab shows what the branch would bring in: the files it
changed since it left its base, grouped by folder, as the pull request on GitHub would show them.
The base starts as the repository's default branch, such as `main`, and `Compared with` lets you pick
another.

## Review pull requests on GitHub

The **Pull requests** tab reads GitHub through the GitHub CLI, `gh`, installed and signed in on your
computer, and Rundesk stores no GitHub token for it. A project with no remote on GitHub says so and
reads nothing. It asks GitHub nothing until you pick it, then lists the
repository's pull requests newest first, 30 at a time, and reads them again every 30 seconds while
it is shown. The open pull request of the branch under **Current branch** is marked `This branch`.

Click one and it opens beside your agents, with its `Conversation`, `Files changed` and `Checks`.
`Checks` shows every check on its latest commit, and `Re-run failed jobs` runs a finished run's
failed jobs again. Under the conversation you can `Comment`, convert it to a draft or mark it ready,
or close and reopen it. **Closing never deletes a branch.**

## Work through issues on GitHub

The **Issues** tab reads GitHub through `gh` too, installed and signed in, only once you pick it, and lists the repository's
issues newest first, 30 at a time, read again every 30 seconds. Filter them by label, by `Open` or
`Closed`, or by `Assigned to me`, `Created by me` or `Mentioning me`.

`New issue` files one, and offers the repository's own issue templates. An open issue lets you
comment, change its labels and assignees, edit its title and description, or close it, as completed
or as not planned. The robot button, `Start an agent on this issue`, opens a new agent in the
project with a prompt naming the issue, passed at launch, never typed in.

## Review work in another branch or worktree

Agents often work in a worktree of their own, a second checkout of the repository in another folder,
and you can review that work without moving anything.
Two buttons sit at the top of Changes: **Current branch** and, when the repository has more than one
checkout, **Current worktree**. Pick a branch or a worktree from either list and Changes reads that
one instead. Nothing is checked out, so your project's folder, terminals and agents stay exactly
where they were.

## Related pages

- [Files & Docs](/docs/docs-view.md): read a project's files and docs whole.
- [Understand code your agents wrote](/docs/understand-agent-code.md): have agents write docs you can check against the code.
- [Workspaces and projects](/docs/projects.md): the project header and its buttons.
