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

# Source Control

> Review and commit changes from FlowDeck

FlowDeck includes source control in the **Changes** tab of the Inspector — the right-side panel. Review your diff, stage files, commit, and push without leaving the app.

## Opening the Changes tab

Click the **Inspector** button in the top-right toolbar to open the Inspector, then select the **Changes** tab. The Changes tab is the default view when the Inspector opens.

## Reviewing changes

The Changes tab shows all modified, added, and deleted files in the working tree. Click any file to see its diff inline.

Files are marked as **Viewed** or **Not Viewed** — use this to track your code review progress across a large diff.

## Staging and committing

Right-click any file to **Stage** or **Unstage** it. Then:

1. Review staged files
2. Type a commit message
3. Click **Commit**

To discard changes in a file, right-click and choose **Discard Changes** — this is destructive and cannot be undone.

In the full review window, **Discard all changes** applies to the complete working tree after confirmation, including binary files that do not appear in the text-diff list. If the repository changes while the confirmation is open, FlowDeck safely cancels the operation and asks you to review again. If any file cannot be discarded, FlowDeck reports that changes remain in the worktree; return to the Changes tab to review them.

## Syncing with remote

The Changes tab shows your branch's relationship to its remote tracking branch and surfaces the right action:

* **Fetch** — when your branch is up to date
* **Pull** — when behind the remote
* **Push** — when ahead of the remote
* **Sync** — when branches have diverged (fetch + pull + push)
* **Publish** — when the local branch has no upstream tracking branch yet

## Upstream commits

The Changes tab also shows recent upstream commits so you can see what's changed on the remote without leaving FlowDeck.

## Pull requests and PR Autopilot

After publishing your branch, use **Open PR** in the Changes tab to create a GitHub pull request. The first time FlowDeck creates a PR successfully, it introduces **PR Autopilot** and lets you choose:

* **One-click commits and PRs:** Generate context-aware commit and PR messages, commit your changes, and open the PR for you.
* **Monitor PRs:** Keep watching for failing checks and merge conflicts so the same agent and context can fix them autonomously, even while you are away.
* **Auto-merge PRs:** Appears after you enable monitoring and merges monitored PRs automatically once their checks pass.

Choose **Save choices** to apply the selected options, or **Maybe later** to leave your current settings unchanged.

You can change all three options later in **Settings > Workflows > Git**. Turning off **Monitor PRs** also turns off and hides **Auto-merge PRs**.

## PR monitoring

Once a session has a pull request, FlowDeck watches it. **Status monitoring is not a setting** —
every worktree with an open session has its PR polled about once a minute, and the result shows
as a badge on the session in the sidebar and in the Changes tab.

| Badge                     | Meaning                                          |
| ------------------------- | ------------------------------------------------ |
| **#123** in gray          | Draft                                            |
| **#123** with a spinner   | Checks are running                               |
| **#123** in green         | Checks passed and the PR is mergeable            |
| **#123** in red           | Checks failed, or the branch has merge conflicts |
| **#123** with a checkmark | Merged                                           |
| **Needs attention**       | Monitoring tried to get it fixed and gave up     |

A conflicting PR reads as failed even when its checks never started, because that is what usually
happens: GitHub does not run CI on a branch it cannot merge, so waiting for a check result would
mean waiting forever.

Sessions you have closed are not polled. Their last known badge stays cached and reappears,
refreshed once, when you reopen the session.

### Monitor PRs

Turning **Monitor PRs** on in **Settings > Workflows > Git** makes monitoring act rather than
just report. When a monitored PR goes red, FlowDeck sends the failure back to the agent that
created it — naming the specific failing checks, or the merge conflict — and asks it to fix the
cause, validate locally, commit, and push.

Some guardrails, so this cannot turn into a loop:

* A new push pings immediately, and resets the count.
* On the same failing commit, FlowDeck waits five minutes before nudging again, and gives up
  after three attempts. Giving up shows as **Needs attention** rather than retrying forever.
* It never interrupts an agent that is busy, in an error state, or waiting on you for a
  permission, a plan approval, or an answer.

The session's chat shows a monitoring banner with **Pause** and **Resume**. Pausing keeps the
status badge updating but stops the fixes and merges until you resume.

### Auto-merge PRs

**Auto-merge PRs** appears only while monitoring is on, and is off by default. With it on, a PR
that goes green is merged for you, using the merge method you pick (squash by default). With it
off, a green PR is left alone for you to merge.

**Delete remote branch after merge** cleans up the head branch afterwards. If GitHub refuses the
merge — branch protection, a required review — FlowDeck logs it and tries again on the next pass,
so an approval that lands later unblocks it without you doing anything.

<Note>
  Monitoring reads pull requests through your connected GitHub account on `github.com`. PRs opened
  from a fork are not detected, and GitHub Enterprise hosts fall back to opening PRs in the
  browser.
</Note>

## Using the agent

The agent will not commit or push without your explicit approval — changes always land in the Changes tab for you to review first.

```text theme={null}
What files have I changed since the last commit?
```

```text theme={null}
Summarize the changes I've made and suggest a commit message.
```

<Note>
  The agent never pushes to a remote without asking you first, even when running in fully autonomous mode.
</Note>
