Skip to content

ofekazar/giti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Slop, git TUI that helps you stage commits quickly

A fast, keyboard-driven terminal UI for git that makes staging, committing, and managing changes quick and efficient.

Features

  • Visual git status with color-coded file states
  • Quick navigation with arrow keys or number shortcuts
  • Fast staging/unstaging with left/right arrows
  • Diff viewing with syntax highlighting (via sieve)
  • Full undo stack - undo any action including commits and checkouts
  • Conflict navigation - automatically jump to conflict markers when editing with vim

Installation

go install github.com/ofekazar/giti@latest

Or build from source:

git clone https://github.com/ofekazar/giti.git
cd giti
go build -o giti .

Usage

Run giti in any git repository:

giti

Keybindings

Key Action
/ Navigate between files
1-9... Jump directly to file by number
Stage file (moves to next file)
Unstage file (moves to next file)
x Checkout (discard changes)
d Show diff of selected file
e Edit file in vim (jumps to conflicts)
c Commit staged changes
z Undo last action
p Exit with undo-all prompt
q Quit normally

Number Navigation

  • Type a single digit (e.g., 1) to jump to that file immediately
  • Type multiple digits quickly (e.g., 10) within 300ms to jump to double-digit files
  • The timeout resets after each digit, allowing you to type numbers like 123 for file 123

Configuration

Diff Viewer

By default, giti uses sieve as the diff viewer. If sieve is not installed, it falls back to view.

You can override the diff viewer by setting the GITI_DIFF_VIEWER environment variable:

export GITI_DIFF_VIEWER=less
giti

Or use it inline:

GITI_DIFF_VIEWER=bat giti

Recommended: Install sieve

For the best diff viewing experience, install sieve:

# Install sieve (check the official repository for installation instructions)

Sieve provides syntax highlighting, better navigation, and a superior viewing experience for git diffs.

How It Works

File Numbers

Files are assigned persistent numbers when first seen in a session. These numbers remain constant throughout the session, making it easy to jump to specific files even as they move between staged/unstaged sections.

Undo Stack

All actions (stage, unstage, checkout, commit) are recorded in an undo stack. You can:

  • Press z to undo the last action
  • Press p to exit and optionally undo all actions

Focus Behavior

When staging/unstaging a file:

  • The cursor moves to the next file in the list
  • If you stage the last file, the cursor moves to the new last file
  • This allows for rapid staging of multiple files

Examples

Quick Workflow

  1. Run giti in your repo
  2. Use to navigate to files you want to stage
  3. Press to stage each file (cursor auto-advances)
  4. Press c to commit
  5. Type your commit message in vim
  6. If you made a mistake, press z to undo the commit

Viewing Diffs

  1. Navigate to a file with / or type its number
  2. Press d to view the diff
  3. The diff opens in sieve (or your configured viewer)
  4. Exit the viewer to return to giti

Undoing Everything

  1. Make some changes (stage, unstage, commit, etc.)
  2. Press p to exit
  3. Confirm with y to undo all actions
  4. Your repository returns to its original state

Requirements

  • Go 1.21 or later
  • Git
  • vim (for commit messages and file editing)
  • sieve (recommended for diff viewing, defaults to view otherwise)

License

MIT License - see LICENSE file for details.

About

An interactive git commit staging TUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages