git-file-history 0.1.0

TUI for browsing the Git history of a single file
git-file-history-0.1.0 is not a library.

git-file-history

TUI for browsing the Git history of a single file

git-file-history shows the commits that touched a file, then lets you open each commit's diff in an interactive terminal UI.

Inspired by: ceuk/git-file-history

Usage

Pass the target file path:

git-file-history path/to/src/main.rs

The path can be relative or absolute. The tool resolves the containing Git repository automatically and can also show history for files that no longer exist, as long as an existing parent directory is inside the repository.

Other commands:

git-file-history --help
git-file-history --version

Key Bindings

List view

Key Action
j / ↓ Move to next commit
k / ↑ Move to previous commit
enter / → View selected commit diff
J / shift+down Move to next commit
K / shift+up Move to previous commit
q Quit
ctrl+c Quit

Diff view

Key Action
j / ↓ Scroll diff down
k / ↑ Scroll diff up
J / shift+down Move to next commit and reload diff
K / shift+up Move to previous commit and reload diff
g Go to top of diff
G Go to bottom of diff
q / ← Return to list view
ctrl+c Quit

Some terminals do not emit distinct shift+arrow key codes; use J and K as the portable fallback.

Requirements

  • Rust 1.88 or newer.
  • Git available on PATH.

If Git is not available, the command exits with an actionable error instead of falling through to a generic process failure.

Installation

Build and install from this repository:

cargo install --path .

Or run without installing:

cargo run -- path/to/src/main.rs

Development

Run the full test suite:

cargo test

Run linting with warnings denied:

cargo clippy --all-targets -- -D warnings

Check formatting:

cargo fmt --check

License

MIT