gitta

command module
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2025 License: MIT Imports: 10 Imported by: 0

README ΒΆ

gitta

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.

demo

✨ Features

  • Visual Git diff viewer in the terminal (default unified view, s toggle 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 --watch flag
  • Fast, minimal, and works well with real Git repositories

πŸš€ Usage

cd path/to/git/repository
gitta

Use the arrow keys or j / k to move, V to start visual selection, and U to stage the selected diff.

Key Bindings

Navigation:

  • j / k or arrow keys β€” move cursor up/down
  • g + g β€” go to top
  • G β€” go to bottom
  • enter β€” switch between file list and diff view
  • q β€” quit

Actions:

  • V β€” start/stop line selection mode
  • a β€” stage selected lines
  • A β€” stage/unstage entire file
  • s β€” toggle split view (side-by-side diff)
Command Line Options

Enable auto-refresh mode to watch for file changes:

gitta --watch

With --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 --debug

πŸ“¦ Installation

go install github.com/yourname/gitta@latest

echo 'export PATH="$PATH:$HOME/go/bin"' >> ~/.bashrc
source ~/.bashrc

Or 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 $PATH

πŸ’‘ Why?

Sometimes 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.


πŸ“‹ License

MIT License

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL