README
¶
graft
A read-first, graph-first terminal Git navigator inspired by Git Graph.
Features
- Full-terminal
git log --graphview with colored refs, subjects, relative time, and author. - Composable graph filters for message, branch, tag, author, and path.
- Fuzzy branch/tag completion in filter mode.
- Vim-style graph search with
/,n, andN. - Keyboard and mouse commit navigation.
Enter/click a commit to expand changed files inline.Enter/click a file to expand an inline side-by-side diff below it.Shift-J/Shift-K,Shift-Down/Shift-Up,PgUp/PgDn, or mouse wheel over the diff scrolls the inline diff.oopens the selected file diff in a full-screen internal diff view.fin full-screen diff toggles between changed hunks and full-file context.Shift-J/Shift-Kin full-screen diff jumps between change occurrences.Escreturns from full-screen diff to the graph.con two commits comparesA..Band shows changed files/diffs for that range.
Requirements
- Go 1.22+
gitdeltafor side-by-side diffs
If delta is missing, graft falls back to a unified git diff.
Install
Install the latest public release with:
go install github.com/BananaBites/graft@latest
Make sure Go's bin directory is on your PATH:
export PATH="$HOME/go/bin:$PATH"
go install puts the binary at $(go env GOPATH)/bin/graft, usually ~/go/bin/graft.
For a specific release/tag:
go install github.com/BananaBites/graft@v0.1.0
Update an existing installation with:
graft --update
or manually:
go install github.com/BananaBites/graft@latest
Usage
Run graft inside a Git repository:
graft
Or start in a specific repository/path:
graft /path/to/repo
Other command-line options:
graft --version
graft --update
graft --completion bash
--update runs go install github.com/BananaBites/graft@latest, so it requires Go to be installed.
Shell completion
Optional shell completion can be installed after graft is available on your PATH.
# bash
mkdir -p ~/.local/share/bash-completion/completions
graft --completion bash > ~/.local/share/bash-completion/completions/graft
# zsh
mkdir -p ~/.zfunc
graft --completion zsh > ~/.zfunc/_graft
printf '\nfpath=(~/.zfunc $fpath)\nautoload -Uz compinit && compinit\n' >> ~/.zshrc
# fish
mkdir -p ~/.config/fish/completions
graft --completion fish > ~/.config/fish/completions/graft.fish
Restart your shell afterwards. You can also just print a completion script with:
graft --completion bash
graft --completion zsh
graft --completion fish
Run from source
go mod tidy
go run .
Filtering
Press : to enter filter mode. Filters are composable; each accepted filter narrows the graph further.
:fix bug # default: commit message grep
:msg fix bug
:branch main # fuzzy-completes branches with Tab
:tag v1.0 # fuzzy-completes tags with Tab
:author hannes
:path main.go
:pop # remove last filter
:clear # clear all filters
F toggles branch/tag filters between:
history: show commits reachable from the branch/tagdecor: match branch/tag names in rendered decorations
Press / for a lightweight search within the currently visible graph, then n / N for next/previous match.
Comparing commits
- Move to the first commit and press
cto mark compare A. - Move to the second commit and press
cto mark compare B. - The inline file list shows changes for
A..B. - Open a file with
Enter, or pressofor full-screen diff.
Keys
| Key | Action |
|---|---|
↑/↓, k/j |
Navigate commits/files; scroll full-screen diff |
g / G |
Jump to top / bottom in graph and full-screen diff |
/ |
Search visible graph text; n/N jump next/previous |
: |
Add graph filter: branch main, tag v1, msg fix, author name, path file |
Tab |
Complete branch/tag while entering a filter |
F |
Toggle branch/tag filters between history mode and decoration-match mode |
Enter, Space, click |
Expand commit or file |
Shift-J / Shift-K, Shift-Down / Shift-Up, PgUp / PgDn |
Scroll inline diff |
o |
Open selected file diff full-screen |
f |
Toggle full-screen diff between hunks and full file |
Shift-J / Shift-K, Shift-Down / Shift-Up |
Jump between changes in full-screen diff |
Esc |
Back out / return from full diff |
c |
Mark compare commit A, then B |
x |
Clear compare |
r |
Reload graph |
:clear |
Clear graph filters |
:pop |
Remove last graph filter |
q, Ctrl-C |
Quit |
Documentation
¶
There is no documentation for this package.