git-diffs
A terminal UI for viewing git diffs between branches, inspired by GitHub's PR diff view.

Features
- Side-by-side diff view - See old and new code side by side, just like GitHub
- Syntax highlighting - Powered by Chroma for beautiful code highlighting
- File list with status indicators - Quickly see what's Added (A), Modified (M), Deleted (D), or Renamed (R)
- Fuzzy search - Quickly find files or search content
- Full-screen TUI - Immersive terminal experience like lazygit
- Keyboard-driven - Navigate entirely with your keyboard
Installation
Using Go Install (Recommended)
go install github.com/matthewmyrick/git-diffs@latest
Make sure $GOPATH/bin is in your PATH:
# Add to ~/.zshrc or ~/.bashrc
export PATH="$PATH:$(go env GOPATH)/bin"
Building from Source
git clone https://github.com/matthewmyrick/git-diffs.git
cd git-diffs
go build -o git-diffs .
# Optional: move to a directory in your PATH
sudo mv git-diffs /usr/local/bin/
Homebrew (Coming Soon)
brew install matthewmyrick/tap/git-diffs
Usage
# Run in any git repository
# Compares current branch against main/master (auto-detected)
git-diffs
# Compare against a specific base branch
git-diffs --base develop
# Compare against a specific commit
git-diffs --base HEAD~5
Keyboard Shortcuts
File List (Left Pane)
| Key |
Action |
↑ / k |
Move up |
↓ / j |
Move down |
Enter |
Select file and view diff |
[ / ] |
Switch view mode (Folder / Type / Raw) |
/ |
Search files (fuzzy) |
Esc |
Clear search |
Diff View (Right Pane)
| Key |
Action |
↑ / k |
Scroll up |
↓ / j |
Scroll down |
Esc |
Return to file list |
Global
| Key |
Action |
← / → |
Switch between panes |
q / Ctrl+C |
Quit |
PgUp / Ctrl+U |
Page up |
PgDn / Ctrl+D |
Page down |
Home / g |
Go to top |
End / G |
Go to bottom |
View Modes
The file list supports three view modes (switch with [ and ]):
- Folder (default) - Files grouped by directory
- Type - Files grouped by change type (Modified, Added, Deleted)
- Raw - Flat list of all files
Requirements
Built With
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add some amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
Roadmap
- GitHub PR integration (fetch diffs from remote PRs)
- Inline comments view
- File tree view
- Custom themes
- Configuration file support
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by lazygit and GitHub's PR interface
- Built with the amazing Charm libraries