# Git Workflow

import { Callout } from "nextra/components"

<GitActions />

Every git action has a keyboard shortcut. Pane shows you the command it will run before executing — no surprises.

## Core actions

**Commit** stages all changes in the pane's worktree and opens a message dialog. Write your message and confirm to create the commit. **Push** sends the branch to remote. **Rebase** pulls the latest from main into your branch, keeping your history clean. **Merge** squash-merges your branch into main and closes the pane.

<Callout type="info">
  Rebase before merge. This ensures your changes sit on top of the latest main and the squash commit applies cleanly.
</Callout>

<Toggle title="Button-only actions: Fetch, Stash, Pop Stash">
**Fetch** updates remote tracking refs without modifying your branch. No keyboard shortcut — click the button in the git toolbar.

**Stash** saves all uncommitted changes to the git stash and clears the working tree. **Pop Stash** restores the most recent stash. Both are click-only and useful when you need a clean slate temporarily.
</Toggle>

<Toggle title="Undo commit">
The undo commit action runs `git reset --soft HEAD~1`, moving the last commit back to staging. Your changes are preserved — only the commit is unwound. Use this to amend a message or split changes before re-committing.
</Toggle>

<Toggle title="Commit attribution">
Commits use your global git identity (`user.name` and `user.email`). Pane does not modify commit attribution.

If you use a custom system prompt or agent configuration that appends a footer to commit messages, that footer appears in the commit body, not the subject line.
</Toggle>

<Toggle title="When actions are disabled">
Git actions are disabled while a pane is in the **running** or **initializing** state. This prevents conflicts between an active agent and a concurrent git operation on the same worktree. Wait for the agent to finish, or stop it manually before committing or pushing.
</Toggle>
