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:
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:
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
JandKas 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:
Or run without installing:
Development
Run the full test suite:
Run linting with warnings denied:
Check formatting:
License
MIT