gitta is a terminal UI tool for interactively staging Git hunks and lines as minimal patches.
It's like git add -p, but better — with a keyboard-driven interface and visual diff selection.
- Visual Git diff viewer in the terminal (default unified view,
stoggle split view mode) - Interactive selection of lines/hunks using Vim-like keys (
j,k,V, etc.) - Apply selected changes as minimal patches (
git apply --cached) - Real-time file watching with
--watchflag - Fast, minimal, and works well with real Git repositories
cd path/to/git/repository
gittaUse the arrow keys or j / k to move, V to start visual selection, and U to stage the selected diff.
Navigation:
j/kor arrow keys — move cursor up/downg+g— go to topG— go to bottomenter— switch between file list and diff viewq— quit
Actions:
V— start/stop line selection modea— stage selected linesA— stage/unstage entire files— toggle split view (side-by-side diff)
Enable auto-refresh mode to watch for file changes:
gitta --watchWith --watch enabled, gitta will automatically refresh the file list and diff view, allowing you to see changes in near real-time as you edit files in your editor.
Enable debug mode and output logs to tmp/:
gitta --debuggo install github.com/yourname/gitta@latest
echo 'export PATH="$PATH:$HOME/go/bin"' >> ~/.bashrc
source ~/.bashrcOr clone and build:
git clone https://github.com/yourname/gitta.git
cd gitta
go build -o gitta
mv gitta /usr/local/bin # or any directory in your $PATHSometimes you want to commit just part of a change — a few lines, not the whole file.
gitta gives you full control over what gets staged, with a cleaner, more intuitive UI than git add -p.
MIT License