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

# Git Integration

> Review staged and unstaged changes, view diffs, track branch status, and work with git worktrees from the Git Changes panel.

# Git Integration

Fabriqa Desktop includes a built-in Git Changes panel that shows the state of your repository in real time. Review diffs, track staged and unstaged changes, and navigate between modified files without leaving the app.

## Opening the Git Changes Panel

* Slash command: **`/git`**
* Command palette: **`Cmd+Shift+P`** → "Show Git Changes"
* Auto-open option: enable **Auto-open Git Changes** in Settings → Developer to have the panel open automatically when changes are detected.

## File Groups

The panel organizes changed files into three groups:

| Group         | Description                                               |
| ------------- | --------------------------------------------------------- |
| **Staged**    | Files added to the git index (`git add`), ready to commit |
| **Unstaged**  | Modified tracked files not yet staged                     |
| **Untracked** | New files not tracked by git                              |

Each group is collapsible. File counts are shown per group.

## Diff Viewer

Click any file in the panel to open its diff. Two modes are available, toggled from the diff viewer header:

* **Unified diff** — changes shown inline with `+`/`-` line markers, similar to `git diff`.
* **Split diff** — old version on the left, new version on the right, side by side.

Syntax highlighting is applied based on file type.

## File Search

A search field at the top of the panel filters the file list by filename. Useful in large changesets when you need to locate a specific file quickly.

## Branch Indicator

The panel header displays the **current branch name** and a **status badge** showing:

* Number of commits ahead of the remote.
* Number of commits behind the remote.
* A dirty indicator when there are local uncommitted changes.

## Worktree Awareness

When a chat is linked to a git worktree (created via `Cmd+Shift+N`), the Git Changes panel shows the changes in that worktree's working directory, not the main workspace. This lets you work on isolated branches without mixing changes.

See [Worktrees](/desktop/worktrees) for the full worktree workflow documentation.

## Completion Actions

At the top of the Git Changes panel, action buttons let you:

* **Merge back** — merge the worktree branch back into the main branch.
* **Open PR** — open a pull request for the worktree branch (links to your git hosting provider).

These actions are available when a worktree session is active.

## Tips

<CardGroup cols={2}>
  <Card title="Stage from the panel" icon="check">
    Click the stage/unstage icons next to individual files to move them between staged and unstaged without running git commands.
  </Card>

  <Card title="Review before committing" icon="eye">
    Open the diff viewer for each changed file before committing to catch unintended changes introduced during an agentic session.
  </Card>

  <Card title="Worktree isolation" icon="git-branch">
    Use worktree chats for experimental changes. The Git Changes panel tracks each worktree independently so main branch state is never at risk.
  </Card>

  <Card title="Auto-open" icon="zap">
    Enable auto-open in Developer settings to surface the panel automatically whenever an agentic run produces file changes.
  </Card>
</CardGroup>
