# Git

For Git projects, the status bar shows the branch, the changes, and pull
request state. Commits and pull requests are written by an AI command-line
tool you already have.

## Branch and changes

- **Branch:** switch, create, or delete branches.
- **Changes:** see changed files with line counts. Stage, unstage, or discard
  them, one at a time or all at once.

## Review

The **Review** tab shows diffs. Open it with **Review…** at the bottom of the
changes list, or with **Diff** on one file. A project has one Review tab.

- **Changes:** staged and unstaged files, each with its diff.
- **History:** commits, newest first. Pick one to see the files it changed.
- **Stashes:** stashes, including the untracked files they saved.

Filter the list by typing. Use the up and down arrow keys to move between
files, and Escape to go back from a commit or stash. Show a diff **Unified** or
**Split** (side by side). Code is colored using your terminal's colors.

Long diffs are shown in part: up to 100,000 lines or 1 MB. Diffs over 20,000
lines are not colored.

## Commit and push

**Commit** asks the AI for a commit message, then commits. Before it starts,
pick the AI tool, whether to include unstaged changes or only what's staged,
and whether to push. Nana remembers these choices for next time. You can also
add one-off instructions for the AI.

## Create a pull request

**Create PR** creates a new branch, commits your changes, pushes, and opens a
pull request with an AI-written title and description. It follows the
repository's pull request template when there is one. It needs uncommitted
changes and a GitHub remote named `origin`.

When the branch has a pull request, the status bar shows its number, state,
and checks. From there you can merge (merge commit, squash, or rebase), update
it from its base branch, close it, or open it on GitHub. In a worktree, you can
also remove the worktree after merging: Nana asks first, then switches to the
primary checkout.

Pull request features need the [`gh`](https://cli.github.com) CLI, installed and
signed in on the project's server.

## AI tools

Nana uses the first installed of: Claude Code (`claude`), Codex (`codex`),
OpenCode (`opencode`), GitHub Copilot (`copilot`), Cursor (`cursor-agent`),
Droid (`droid`), Grok (`grok`), Kiro CLI (`kiro-cli`), Pi (`pi`), Xal (`xal`),
Antigravity (`agy`), and Oh My Pi (`omp`).

In **Settings → AI**, pick the tool for commits and for pull requests, and edit
their prompts. A project can have its own pull request prompt, set from the
**Create PR** menu.

- Sign in to the tool in a terminal first. Nana runs it without prompts.
- The tool runs on this computer, in the project folder. For a
  [remote project](https://nana.areshk.dev/docs/features/remote-servers.md), the same folder must exist here.
- Nana itself always does the staging, committing, pushing, and pull request.
  The AI only writes the text.