---
title: Source Control
description: "Git in Agentastic — the source control navigator, commits and branches, the agents panel, pull requests, stashing, and remote operations."
updated: "2026-09-19"
---

## Overview

Agentastic includes comprehensive Git integration for managing your repositories directly from the editor.

## Source Control Navigator

Open the Source Control Navigator from the left sidebar to see:
- **Changes** - Modified, staged, and untracked files
- **Branches** - Local and remote branches
- **Stashes** - Saved work in progress
- **Remotes** - Connected remote repositories

## Basic Operations

### Viewing Changes
- Files with changes show status indicators in the Navigator
- Click a changed file to view the diff
- Staged and unstaged changes are shown separately

### Staging & Committing

1. Select files to stage in the Source Control Navigator
2. Enter a commit message
3. Click **Commit** or press <kbd>Cmd</kbd>+<kbd>Enter</kbd>

### Branch Management

| Action | How To |
|--------|--------|
| Create Branch | Click **+** in Branches section |
| Switch Branch | Double-click a branch |
| Merge Branch | Right-click > Merge into current |
| Delete Branch | Right-click > Delete |

## Agents Panel

Agentastic has first-class support for git worktrees via the Agents panel, allowing you to work on multiple branches simultaneously.

### What are Agents?

Agents use git worktrees to let you check out multiple branches at once, each in its own directory. This is useful for:
- Reviewing PRs while working on features
- Quick bug fixes without stashing
- Comparing implementations across branches
- Running AI coding agents in isolated environments

### Navigating Agents

| Action | Shortcut |
|--------|----------|
| Switch Worktree | <kbd>Ctrl</kbd>+<kbd>Tab</kbd> |
| Next Agent | <kbd>Cmd</kbd>+<kbd>Option</kbd>+<kbd>Down</kbd> |
| Previous Agent | <kbd>Cmd</kbd>+<kbd>Option</kbd>+<kbd>Up</kbd> |

### Managing Agents

Manage agents from the navigator sidebar:
- View all agents for the current repository
- Create new agents with **+** at the bottom of the sidebar or **File > New Workspace…** (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>T</kbd>)
- Switch between agents by clicking them
- Remove unused agents with right-click → **Delete Workspace**

## Pull Requests

Open a GitHub pull request as a tab and review it without leaving the editor — read and edit the description, browse the conversation, reply to review comments inline, watch CI checks, and merge (merge, squash, or rebase) or mark a draft ready for review. Any comment thread can be sent straight into an agent chat to act on the feedback.

Click a pull request number in the Agents navigator to open its native pull request panel. Use a modifier to choose where it opens:

| Gesture | Opens in |
|---------|----------|
| Click | A trailing split when the editor has a single pane; otherwise the current editor |
| <kbd>Option</kbd>+click | The current editor as a tab without creating a split |
| <kbd>Cmd</kbd>+click | Your external browser |

If that pull request panel is already open, Agentastic focuses the existing tab instead of moving or duplicating it.

### Panel Layout

The panel adapts to the width you give it, so it stays usable in a narrow split as well as full screen:

| Width | Layout |
|-------|--------|
| Wide | A sidebar alongside the conversation with status, reviewers, checks, and the changed-file list |
| Medium | A single reading column; status, reviewers, and checks fold into the header |
| Narrow | Compact header with the title, number, and byline stacked; details collapse into a summary row |

The header stays pinned while you scroll, so the pull request's identity — title, number, state, branch — and its actions are always in reach, however far down the conversation you are.

Selecting a file in the sidebar jumps to that file's diff. In the **Files** section every file loads; in **Overview**, a wide panel loads a preview of the diff alongside the conversation.

### Merge Conflicts

When GitHub reports that a pull request can't be merged cleanly, the panel shows an explicit red **Merge Conflict** state in place of the merge and squash actions, and lists the conflicting files — for both local and remote (SSH) repositories.

Use **Add to Chat** to turn the conflict into work: Agentastic builds a conflict-fix prompt and either hands it to a live agent in that exact worktree, or — when it can't verify a running agent at the pull request's head revision — stages it in a worktree-scoped [Quick Agent](/docs/features/agent-home#quick-agent) composer so you can review before sending.

## Diff Viewer

The diff viewer shows changes with syntax highlighting:
- **Green** - Added lines
- **Red** - Removed lines
- Navigate between changes with the diff controls

## Stashing

Save work in progress without committing:

1. Right-click in Source Control Navigator
2. Select **Stash Changes**
3. Enter an optional stash message

Apply stashes from the Stashes section of the Navigator.

## Remote Operations

| Action | Description |
|--------|-------------|
| Fetch | Download remote changes |
| Pull | Fetch and merge remote changes |
| Push | Upload local commits to remote |

Access these from the Source Control Navigator toolbar or the **Source Control** menu.
