ConfigsJul 20, 2026·3 min read

forgit — Interactive Git Commands Powered by fzf

A utility that wraps common Git operations with fzf fuzzy-finder interfaces, making log browsing, staging, stashing, and branch switching interactive and visual.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
forgit Interactive Git
Direct install command
npx -y tokrepo@latest install d94b4542-8419-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

forgit is a Zsh/Bash plugin that adds interactive fuzzy-finder interfaces to everyday Git commands using fzf. Instead of memorizing flags for git log, git diff, git add, and git stash, users get a searchable, preview-enabled selection UI. It turns Git workflows from recall-based to recognition-based.

What forgit Does

  • Provides interactive git log browsing with commit diff preview in a side pane
  • Adds fuzzy file selection to git add with inline diff preview for each file
  • Enables interactive branch switching, deletion, and checkout with fzf
  • Wraps git stash operations with searchable stash list and preview
  • Supports interactive cherry-pick, revert, fixup, and clean operations

Architecture Overview

forgit is a shell script that defines functions wrapping standard Git commands with fzf piped output. Each function runs a Git command, feeds the output to fzf with a preview command (typically git diff or git show), and passes the selected items back to the appropriate Git operation. It hooks into the shell via aliases (ga, glo, gd, gcf, etc.) for quick access.

Self-Hosting & Configuration

  • Install via any Zsh plugin manager (zplug, zinit, antigen) or source the script directly
  • Requires fzf and Git to be installed and available in PATH
  • Customize key bindings, colors, and preview window layout via FORGIT_* environment variables
  • Override default aliases by setting FORGIT_NO_ALIASES=1 and defining your own
  • Works with both Zsh and Bash shells

Key Features

  • Interactive log viewer with side-by-side commit diff preview
  • Fuzzy file staging with per-file diff preview before adding
  • Interactive branch, tag, and stash management through fzf
  • Customizable aliases, keybindings, and fzf display options
  • Supports git clean, cherry-pick, revert, fixup, and rebase operations

Comparison with Similar Tools

  • lazygit — full terminal UI for Git; forgit enhances individual commands rather than replacing the workflow
  • GitUI — Rust-based Git TUI; forgit is lighter and integrates directly into the shell
  • tig — text-mode Git interface; forgit uses fzf for fuzzy search rather than a dedicated UI
  • git-interactive-rebase-tool — focuses only on rebase; forgit covers many Git operations
  • fzf built-in git bindings — basic key bindings; forgit provides richer previews and more operations

FAQ

Q: Does forgit work with Bash? A: Yes. It supports both Zsh and Bash, though Zsh plugin managers make installation easiest.

Q: What are the default aliases? A: ga (add), glo (log), gd (diff), grh (reset HEAD), gcf (checkout file), gss (stash show), gclean (clean), and more.

Q: Can I customize the fzf preview window? A: Yes. Set FORGIT_FZF_DEFAULT_OPTS or per-command variables like FORGIT_LOG_FZF_OPTS.

Q: Does forgit modify my Git config? A: No. It only wraps Git commands at the shell level without changing any Git configuration.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets