Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sukechannnn/gitta

Repository files navigation

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

About

Interactive terminal UI for staging Git diffs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages