Git Integration
Overview
Section titled “Overview”Navi displays git information for each session’s working directory: current branch, dirty status, ahead/behind counts, last commit, and GitHub PR detection.
Inline Display
Section titled “Inline Display”Each session row shows git info when available:
⚙️ my-session 3m ago ~/projects/app feature/login ● +3 [PR #42]- Branch name: Current branch (truncated to 30 characters)
- Dirty indicator:
●when there are uncommitted changes - Ahead/behind:
+3commits ahead,-1commits behind remote - PR number:
PR#42when a GitHub PR is detected for the branch
Detail View
Section titled “Detail View”Press G to open the git detail view for the selected session. This shows:
- Full branch name
- Remote URL
- Last commit (hash + subject)
- Ahead/behind counts
- GitHub PR link
- Recent diffs (up to 5000 lines)
GitHub PR Detection
Section titled “GitHub PR Detection”Navi auto-detects GitHub PRs by:
- Parsing the git remote URL (HTTPS or SSH format)
- Extracting the owner and repository name
- Using
gh pr view --json numberto look up PRs for the current branch - Caching the result to avoid repeated API calls
The gh CLI must be installed and authenticated for PR detection to work.
How It Works
Section titled “How It Works”Git information is polled separately from session status:
- Local sessions: Runs
gitcommands in the session’s working directory - Remote sessions: Executes a bundled git info script over SSH (
cd <cwd> && git branch --show-current && git status --porcelain && ...) - Cache: Git info is cached with a 5-second TTL and 10-second max age
- PR cache: PR numbers are cached per branch to minimize
ghAPI calls
Related Features
Section titled “Related Features”- Session Monitoring — Session status display
- Remote Sessions — Git info for remote sessions
- Content Viewer — Viewing git diffs in-app