# Git Workflow

<GitActions />

The buttons live in the **Details** tab of the right panel (⌘⌥B). For the step-by-step flow, see [Review & Commit](/docs/review-and-commit).

## Core actions

| Action | macOS | Windows / Linux | Git it runs |
|--------|-------|-----------------|-------------|
| Commit | ⌘⇧K | Ctrl+Shift+K | `git add -A`, then `git commit` |
| Push | ⌘⇧U | Ctrl+Shift+U | `git push`, or `git push -u origin HEAD` the first time |
| Pull | ⌘⇧L | Ctrl+Shift+L | `git pull` |
| Undo commit | ⌘⌥Z | Ctrl+Alt+Z | `git reset --soft HEAD~1` |
| Rebase from main | ⌘⇧R | Ctrl+Shift+R | `git rebase <base>` |
| Merge to main | ⌘⌥⇧M | Ctrl+Alt+Shift+M | See [below](#merge-to-main) |
| Fetch | Button | Button | `git fetch --all` |
| Stash | Button | Button | `git stash push -m "pane stash"`: saves uncommitted changes and clears the worktree |
| Pop | Button | Button | `git stash pop` |

> **Note:** `<base>` is the branch you picked when you created the pane, such as `main` or `origin/main`. "Main" in an action's name means `<base>`.

**Undo commit** only undoes commits not yet on `<base>`, and keeps the changes staged. **Rebase** checks for conflicts first. If it finds any, nothing changes and the error dialog offers **Use Claude Code to Resolve**.

## Merge to main

The **Merge to `<base>`** dialog shows these commands before you confirm. With **Squash commits into one** (on by default):

```bash
# In the pane's worktree
git rebase <base>
git reset --soft $(git merge-base <base> HEAD)
git commit -m "<message>"
# In your main checkout
git checkout <base>
git merge --ff-only <branch>
```

Without squash, Pane skips the reset and commit.

Merge targets your local branch (`main` for `origin/main`) and doesn't push. It switches your main checkout, the repo folder you added, to `<base>` and leaves it there. Pull `<base>` in your main checkout before you merge, or your later push is rejected.

> **Warning:** Uncommitted changes in your main checkout that the switch would overwrite stop the merge.

**Merge & Archive** merges, then [archives the pane](/docs/panes-and-worktrees#archive-or-delete-a-pane), even though the merge isn't pushed yet.

## Commit attribution

You stay the author, from your git `user.name` and `user.email`. In **Settings → Worktrees & Git → Git behavior**, both of these are on by default:

1. **Attribute commits to Pane** sets the committer to `Pane <runpane@users.noreply.github.com>` on every commit made through Pane, including in its terminals. GitHub shows "committed by Pane" next to your name. Turning it off applies to terminals opened afterwards.
2. **Include Pane footer in commits** adds a `Co-Authored-By: Pane` line to commits from the Commit and Merge actions.
