gitwhen vs tig — git history search vs TUI browser

Both tools help you explore git history. gitwhen is a focused CLI that answers one question: when did this string, line, or file change? tig is a full-screen ncurses browser for navigating all of git interactively. They are complementary, not competing.

gitwhen

  • One command to find when a string, line, or file appeared in history
  • Wraps git log -S, git blame, and git log --diff-filter=A
  • Four modes: string / line / file / regex
  • Zero runtime dependencies beyond git
  • Output in plain text or JSON for scripting
  • Works in CI pipelines and editor integrations
  • Instant answer — no navigation required
  • Install via npm, Homebrew, or binary download

tig

  • Full-screen ncurses TUI for browsing git history
  • Navigate commits, diffs, blame, refs, stash interactively
  • Can search commit messages inside the TUI
  • No dedicated mode for git log -S style string-in-diff search
  • Requires manual navigation to pinpoint a specific change
  • Not designed for scripting or non-interactive use
  • Excellent for code review and broad history exploration
  • Install via package manager (apt, brew, etc.)
use gitwhen →

Feature comparison

Featuregitwhentig
Primary use caseFind when a specific string/line changedBrowse full git history interactively
InterfaceCLI / non-interactivencurses TUI (full-screen)
git log -S string-in-diff search✓ dedicated mode— must run separately
git blame integration✓ built-in✓ blame view
Regex search across diffs
Interactive history browser
Commit diff viewer
JSON output for scripting
CI pipeline safe— requires TTY
Runtime dependenciesZero (git only)ncurses, git
Installnpm i -g gitwhen / brewbrew install tig / apt
Best forPinpointing a specific change fastBroad history exploration and review

When to use gitwhen

  • You need to know exactly which commit introduced a specific string or deleted a specific line
  • You want a scripted check in CI to alert when a pattern reappears
  • You are debugging a regression and want the first commit where the function changed
  • You need machine-readable JSON output to feed into another tool

When to use tig

  • You want to browse commit history like a file browser
  • You are doing a code review and want to walk through diffs interactively
  • You want to visualize branches, tags, and stashes in one view
  • You prefer keyboard-driven navigation over typed commands

Frequently asked questions

What does gitwhen do that tig does not?
gitwhen is purpose-built for one question: when did this specific string, line, or file first appear or last change in git history? It wraps git log -S, git blame, and git log --diff-filter=A so you can answer that with a single command and zero setup. tig is a general-purpose interactive git browser — it shows you history, diffs, and file trees, but you have to navigate manually to find what you want.
Does gitwhen require any dependencies?
No. gitwhen has zero runtime dependencies beyond git itself. Install it with npm install -g gitwhen, brew install gitwhen, or download the binary for your platform. tig also has no unusual dependencies but requires a terminal that supports ncurses.
Can tig search for when a string was added to the codebase?
tig can search commit messages with / inside its log view, but it does not have a dedicated mode for git log -S style string-in-diff search. You would need to run git log -S from the command line and then open the resulting commit hash in tig. gitwhen does this in one step.
Is gitwhen scriptable?
Yes. gitwhen outputs plain text or JSON depending on the --json flag, so it integrates into shell scripts, CI pipelines, and editor plugins. tig is interactive-first and is not designed for non-interactive scripting.

Try gitwhen

Find when a string, line, or file changed in git history — one command, zero deps, plain text or JSON output.

open gitwhen →

Competitor names and trademarks belong to their respective owners. This comparison reflects publicly observable tool behavior.