Skip to main content
View your commit history as a visual graph directly in the terminal.

Usage

wit graph

Output

● a1b2c3d4 (HEAD -> main) Latest commit - Alice, today
● e5f6g7h8 Add user authentication - Bob, yesterday

│ ● f9g0h1i2 (feature-branch) Feature work - Charlie, 2 days ago
│ ● j3k4l5m6 More feature work - Charlie, 3 days ago
├─┘
● n7o8p9q0 Merge pull request #42 - Alice, 1 week ago
├─╮
│ ● r1s2t3u4 Fix critical bug - Bob, 1 week ago
├─╯
● v5w6x7y8 Initial commit - Alice, 2 weeks ago

Understanding the Graph

Symbols

SymbolMeaning
Commit
Branch line
├─╮Merge (two parents)
├─╯Branch rejoins
├─┘Branch divergence

Labels

LabelMeaning
HEAD -> mainCurrent branch
(main)Branch name
(tag: v1.0)Tag
(origin/main)Remote branch

Options

# Show all branches
wit graph --all

# Limit number of commits
wit graph -n 10

Example Scenarios

Linear History

● Latest commit
● Previous commit
● Earlier commit
● Initial commit

Feature Branch

● (main) Latest on main

│ ● (feature) Feature commit 2
│ ● Feature commit 1
├─┘
● Base commit

Merge Commit

● Merge feature into main
├─╮
│ ● Feature work
│ ● More feature work
├─╯
● Earlier main work

Multiple Branches

● (main) Latest

│ ● (feature-a) Work on A
├─┤
│ │ ● (feature-b) Work on B
├─┼─╯
│ ●
├─╯
● Base

When to Use

The graph command is perfect for:
  • Quick overview: See branch structure at a glance
  • Before merging: Understand what will be merged
  • After merging: Verify merge was successful
  • Debugging: Find where branches diverged
  • Scripting: Output is parseable

Comparison

NeedUse
Quick glance at historywit graph
Detailed commit infowit log
Interactive explorationwit web
Full-featured terminalwit ui

Tips

Combine with grep for quick searches:
wit graph | grep "feature"
Use -n to limit output for large repositories:
wit graph -n 20