Skip to content

Git integration

Hive treats git as a first-class workspace signal. Three surfaces:

  1. Status pill in the workspace bar — branch, dirty count, ahead/behind.
  2. Git pane on the right rail — per-file status (staged / changed / untracked).
  3. Built-in git tools — agents can call git_status, git_diff, git_log, git_show, git_commit.

Git pill in workspace bar

Status pill

The pill shows:

  • The current branch name (or "detached" / "no git" as appropriate).
  • A warm-tinted badge with the dirty count (modified + untracked + staged) when non-zero.
  • Up / down arrows + counts for ahead/behind.

Click the pill to refresh. Hive doesn't poll git automatically — running git status constantly would be wasteful — but every chat mutation refreshes the snapshot, and you can click any time.

Per-file pane

Open the Git pane (📈 icon on the right rail). Three groups:

  • Staged — files in the index, ready to commit.
  • Changed — modified or untracked-tracked files not yet staged.
  • Untracked — files git doesn't know about.

Each row shows the file path, the change kind (M / A / D / R / ? / U), and a tint by kind. Click the refresh button on the pane header to re-run git status --porcelain=v1.

Built-in tools for agents

The default tool registry includes five git tools. The LLM sees them with proper JSON schemas; the runtime synthesizes the right git <subcommand> invocation when called.

Tool Effect Approval
git_status git status --short --branch no
git_diff git diff [--staged] [-- <path>] no
git_log git log --oneline -n <limit> no
git_show git show <ref> (default HEAD) no
git_commit git commit -m <message> yes

The read-only tools (status / diff / log / show) bypass consent. Anything that writes history — git_commit — requires approval. Other write operations (push, branch, merge, rebase, reset, tag) are NOT exposed as built-ins; agents that want them call run_workspace_command and the user approves the specific command.

This is intentional — git push to a public remote is high-stakes; we'd rather make the user read the exact command line than ship a schema for it.

Future

  • A "Stage selected files" affordance from the Git pane.
  • Inline diff viewer in the right rail's Files mode.
  • Per-hunk staging (the JJ-style "select these chunks" interaction).
  • Git LFS / git-annex awareness.

None of these are blockers — run_workspace_command already lets an agent do anything git can do, with user approval per command.