# forgit

> Interactive Git command wrapper using fzf for fuzzy selection of files, commits, branches, and more

Stars: 5.1k · Language: Shell · License: MIT · Categories: Git

- Repository: https://github.com/wfxr/forgit
- Page: https://www.trmn.sh/tools/forgit

## Install

- Homebrew: `brew install forgit`
- oh-my-zsh: `git clone https://github.com/wfxr/forgit.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/forgit`
- fisher: `fisher install wfxr/forgit`

## Overview

forgit is a Git wrapper that adds interactive fuzzy selection to common Git operations using fzf. It provides 25+ commands with short aliases that replace standard Git commands with searchable, selectable interfaces. Commands like `ga` for interactive `git add`, `glo` for browsing commit history, and `gcb` for branch switching display relevant Git data in fzf menus where users can search and select items with keyboard navigation.

The tool covers comprehensive Git workflows including staging files, viewing diffs and logs, managing branches and tags, handling stashes, cherry-picking commits, interactive rebasing, and worktree management. Each command can be customized through environment variables to modify both Git options and fzf behavior. For example, branch commands can be configured to sort by commit date, or diff commands can use custom Git options.

forgit works across Bash, Zsh, and Fish shells and can be installed through package managers, shell plugin managers, or as a Git subcommand. It requires fzf 0.60.0 or higher and integrates with existing Git configurations for pagers and diff tools. The tool is designed for developers who frequently use Git from the command line and want to reduce the cognitive overhead of remembering exact commit hashes, branch names, or file paths.

### Installation

```bash
# via Homebrew
brew install forgit
```

```bash
# via oh-my-zsh
git clone https://github.com/wfxr/forgit.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/forgit
```

```bash
# via fisher
fisher install wfxr/forgit
```

![Interactive git add selector](https://media.trmn.sh/cached/fd3d65295b63cd188c3640699f8542233d735d744e77320f5402ed59a5d9e5fe.png)

![Interactive git log viewer](https://media.trmn.sh/cached/ef5e8ad47e3b1f0f1df382d890b7920892ef292c0da6939ce5c48cca33b94dba.png)

![Interactive .gitignore generator](https://media.trmn.sh/cached/a088fbe500c4bf8ad6f287a24d108270cb0d6ffdddfa6a04a3a23d55ecf8f92c.png)

## Alternatives

- [git-secrets](https://www.trmn.sh/tools/git-secrets.md): Prevents committing passwords and sensitive information to git repositories using pattern matching and hooks (Shell, 13.4k stars)
- [Git Extras](https://www.trmn.sh/tools/git-extras.md): A collection of extra git subcommands, including git-ignore, git-setup, git-changelog, git-release, git-effort, git-squash and git-pull-request. (Shell, 18.1k stars)
- [git absorb](https://www.trmn.sh/tools/git-absorb.md): Git subcommand that automatically creates fixup! commits from staged changes by finding the commit each hunk belongs to, with optional autosquash rebase. (Rust, 5.8k stars)
- [yadm](https://www.trmn.sh/tools/yadm.md): Dotfiles manager built on Git, with per-system alternate and templated files, encryption via GnuPG/OpenSSL/transcrypt/git-crypt, bootstrapping, and hooks. (Python, 6.5k stars)
- [gitu](https://www.trmn.sh/tools/gitu.md): Terminal user interface for Git inspired by Magit, providing visual staging, branching, and repository management (Rust, 2.9k stars)

## Guides

- [lazygit Alternatives](https://www.trmn.sh/alternatives/lazygit): lazygit alternatives compared: gitui, gitu and tig as terminal Git UIs, plus forgit for fzf-based Git commands in Bash, Zsh and Fish.

---

Canonical: https://www.trmn.sh/tools/forgit
