tg is a fast, minimal git diff viewer for the terminal. Run it in a repo to scroll through everything you've changed since your last commit, with syntax highlighting and a few lines of surrounding context. It updates live as files change, and you can commit and push without leaving it.
macOS and Linux:
curl -LsSf https://github.com/tcmarkfeld/terminal-git/releases/latest/download/tg-installer.sh | shOr from source with Rust:
cargo install --git https://github.com/tcmarkfeld/terminal-gittg # everything changed since HEAD, including untracked files
tg main...HEAD # any arguments are passed straight to `git diff`
tg update # update to the latest release
tg help # usage and keys| Key | Action |
|---|---|
j k |
Next / previous file |
| scroll | Scroll |
d u / Space b |
Half page / full page |
g G |
Top / bottom |
m o |
Collapse / open the current file (or click its header) |
h l |
Scroll sideways (long lines wrap automatically in narrow windows) |
⌘O or f |
File finder |
⌘/ |
Commit dialog |
v or click / drag |
Select lines to comment on (j k extend, c comment, esc cancel) |
r |
Reload |
⌥/ or ? |
All shortcuts |
q |
Quit |
In the commit dialog: type a message, Tab to pick files (Space toggles, a toggles all), then ⏎ to commit, ⌘\ to commit and push, or ⌘U to push. If your terminal doesn't pass ⌘ through, Ctrl works for the finder, commit dialog, and commit and push.
In the Rex terminal, select lines and press c to send a comment about them to a coding agent (Claude Code, Codex, Gemini, opencode, Aider, and others) running in another pane. The agent in the same tab is picked by default; ↑ ↓ chooses another. The agent receives the file, line numbers, the selected diff lines, and your comment.
MIT