SkillAgentSearch skills...

Forgit

:zzz: A utility tool powered by fzf for using git interactively.

Install / Use

/learn @wfxr/Forgit
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<h1 align="center">💤 forgit</h1> <p align="center"> <em>Utility tool for using git interactively. Powered by <a href="https://github.com/junegunn/fzf">junegunn/fzf</a>.</em> </p> <p align="center"> <a href="https://github.com/wfxr/forgit/actions"> <img src="https://github.com/wfxr/forgit/workflows/ci/badge.svg"/> </a> <a href="https://wfxr.mit-license.org/2017"> <img src="https://img.shields.io/badge/License-MIT-brightgreen.svg"/> </a> <a href="https://img.shields.io/badge/Shell-Bash%20%7C%20Zsh%20%7C%20Fish-blue"> <img src="https://img.shields.io/badge/Shell-Bash%20%7C%20Zsh%20%7C%20Fish-blue"/> </a> <a href="https://github.com/unixorn/awesome-zsh-plugins"> <img src="https://img.shields.io/badge/Awesome-zsh--plugins-d07cd0?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABVklEQVRIS+3VvWpVURDF8d9CRAJapBAfwWCt+FEJthIUUcEm2NgIYiOxsrCwULCwktjYKSgYLfQF1JjCNvoMNhYRCwOO7HAiVw055yoBizvN3nBmrf8+M7PZsc2RbfY3AfRWeNMSVdUlHEzS1t6oqvt4n+TB78l/AKpqHrdwLcndXndU1WXcw50k10c1PwFV1fa3cQVzSR4PMd/IqaoLeIj2N1eTfG/f1gFVtQMLOI+zSV6NYz4COYFneIGLSdZSVbvwCMdxMsnbvzEfgRzCSyzjXAO8xlHcxMq/mI9oD+AGlhqgxjD93OVOD9TUuICdXd++/VeAVewecKKv2NPlfcHUAM1qK9FTnBmQvJjkdDfWzzE7QPOkAfZiEce2ECzhVJJPHWAfGuTwFpo365pO0NYjmEFr5Eas4SPeJfll2rqb38Z7/yaaD+0eNM3kPejt86REvSX6AamgdXkgoxLxAAAAAElFTkSuQmCC"/> </a> <a href="https://github.com/pre-commit/pre-commit"> <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white" alt="pre-commit" /> </a> <a href="https://github.com/wfxr/forgit/graphs/contributors"> <img src="https://img.shields.io/github/contributors/wfxr/forgit" alt="Contributors"/> </a> </p>

This tool is designed to help you use git more efficiently. It's lightweight and easy to use.

📝 Features

ga - Interactive git add selector:

screenshot

glo - Interactive git log viewer:

screenshot

gi - Interactive .gitignore generator:

screenshot

Full Command List

| Command | Description | |----------|-------------| | ga | Interactive git add selector | | gd | Interactive git diff viewer | | gi | Interactive .gitignore generator | | glo | Interactive git log viewer | | gat | Interactive .gitattributes generator | | gso | Interactive git show viewer | | grh | Interactive git reset HEAD <file> selector | | gcf | Interactive git checkout <file> selector | | gcff | Interactive git checkout <file> from <commit> selector | | gcb | Interactive git checkout <branch> selector | | gsw | Interactive git switch <branch> selector | | gbd | Interactive git branch -D <branch> selector | | gct | Interactive git checkout <tag> selector | | gco | Interactive git checkout <commit> selector | | grc | Interactive git revert <commit> selector | | gss | Interactive git stash viewer | | gsp | Interactive git stash push selector | | gcp | Interactive git cherry-pick selector | | grb | Interactive git rebase -i selector | | grl | Interactive git reflog viewer | | gbl | Interactive git blame selector | | gfu | Interactive git commit --fixup && git rebase -i --autosquash selector | | gsq | Interactive git commit --squash && git rebase -i --autosquash selector | | grw | Interactive git commit --fixup=reword && git rebase -i --autosquash selector | | gclean | Interactive git clean selector | | gwt | Interactive git worktree selector | | gwa | Interactive git worktree add selector | | gwd | Interactive git worktree remove selector |

📥 Installation

Requirements

  • fzf version 0.49.0 or higher

    If your OS package manager bundles an older version of fzf, you might install it using fzf's own install script.

Shell Package Managers

# for zplug
zplug 'wfxr/forgit'

# for zgen
zgen load 'wfxr/forgit'

# for antigen
antigen bundle 'wfxr/forgit'

# for fisher (requires fisher v4.4.3 or higher)
fisher install wfxr/forgit

# for omf
omf install https://github.com/wfxr/forgit

# for zinit
zinit load wfxr/forgit

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

# for sheldon.cli
[plugins.forgit]
github = "wfxr/forgit"
rev = "26.01.0"  # check https://github.com/wfxr/forgit/releases for latest version
use = ["forgit.plugin.zsh"]
apply = ["source"]

# manually
# Clone the repository and source it in your shell's rc file or put bin/git-forgit into your $PATH

Homebrew

To install using brew

brew install forgit

Then add the following to your shell's config file:

# Fish:
# ~/.config/fish/config.fish:
[ -f $HOMEBREW_PREFIX/share/forgit/forgit.plugin.fish ]; and source $HOMEBREW_PREFIX/share/forgit/forgit.plugin.fish

# Zsh:
# ~/.zshrc:
[ -f $HOMEBREW_PREFIX/share/forgit/forgit.plugin.zsh ] && source $HOMEBREW_PREFIX/share/forgit/forgit.plugin.zsh

# Bash:
# ~/.bashrc:
[ -f $HOMEBREW_PREFIX/share/forgit/forgit.plugin.sh ] && source $HOMEBREW_PREFIX/share/forgit/forgit.plugin.sh

Arch User Repository

AUR packages, maintained by the developers of forgit, are available. Install the forgit package for the latest release or forgit-git to stay up to date with the latest commits from the default branch of this repository.

Completions

Forgit offers completions for all supported shells. Completions are automatically configured when installing forgit through Homebrew or the AUR. All other installation methods mentioned above require manual setup for completions. The necessary steps depend on the shell you use.

Bash

  • Put completions/git-forgit.bash in ~/.local/share/bash-completion/completions to have bash tab completion for git forgit and configured git aliases.
  • Source completions/git-forgit.bash explicitly to have bash tab completion for forgit shell functions and aliases (e.g., gsw <tab> completes branches).

Fish

  • Put completions/git-forgit.fish in ~/.config/fish/completions/ to have fish tab completion for git forgit and configured git aliases, as well as shell command aliases, such as ga.

Zsh

  • Put completions/_git-forgit in a directory in your $fpath (e.g., /usr/share/zsh/site-functions) to have zsh tab completion for git forgit and configured git aliases, as well as shell command aliases, such as forgit::add and ga.

If you're having issues after updating, and commands such as forgit::add or aliases ga aren't working, remove your completions cache and restart your shell.

> rm ~/.zcompdump
> zsh

🚀 Usage

Shell Aliases

You can change the default aliases by defining these variables below before sourcing the forgit shell plugin. (To disable all aliases, Set the FORGIT_NO_ALIASES flag.)

forgit_log=glo
forgit_reflog=grl
forgit_diff=gd
forgit_show=gso
forgit_add=ga
forgit_reset_head=grh
forgit_ignore=gi
forgit_attributes=gat
forgit_checkout_file=gcf
forgit_checkout_file_from_commit=gcff
forgit_checkout_branch=gcb
forgit_switch_branch=gsw
forgit_branch_delete=gbd
forgit_checkout_tag=gct
forgit_checkout_commit=gco
forgit_revert_commit=grc
forgit_clean=gclean
forgit_stash_show=gss
forgit_stash_push=gsp
forgit_cherry_pick=gcp
forgit_rebase=grb
forgit_blame=gbl
forgit_fixup=gfu
forgit_squash=gsq
forgit_reword=grw
forgit_worktree=gwt
forgit_worktree_add=gwa
forgit_worktree_delete=gwd

Git Integration

You can use forgit as a sub-command of git by making git-forgit available in $PATH:

# after `forgit` was loaded
PATH="$PATH:$FORGIT_INSTALL_DIR/bin"

Some plugin managers can help do this.

Then, any forgit command will be a sub-command of git:

git forgit log
git forgit add
git forgit diff

Optionally you can add aliases in git:

git config --global alias.cf 'forgit checkout_file'

And use forgit functions via a git alias:

git cf

⚙ Configuration

Options can be set via environment variables. They have to be exported in order to be recognized by forgit.

For instance, if you want to order branches in gcb by the last committed date you could:

export FORGIT_CHECKOUT_BRANCH_BRANCH_GIT_OPTS='--sort=-committerdate'

Per-command Options

Each forgit command can be customized with dedicated environment variables for git arguments and fzf options:

| Command | Git Options | FZF Options | |----------|-------------|-------------| | ga | FORGIT_ADD_GIT_OPTS | FORGIT_ADD_FZF_OPTS | | glo | FORGIT_LOG_GIT_OPTS | FORGIT_LOG_FZF_OPTS | | grl | FORGIT_REFLOG_GIT_OPTS | FORGIT_REFLOG_FZF_OPTS | | gi | | FORGIT_IGNORE_FZF_OPTS | | gat | | FORGIT_ATTRIBUTES_FZF_OPTS | | gd | FORGIT_DIFF_GIT_OPTS | FORGIT_DIFF_FZF_OPTS | | gso | FORGIT_SHOW_GIT_OPTS | FORGIT_SHOW_FZF_OPTS | | grh | FORGIT_RESET_HEAD_GIT_OPTS | FORGIT_RESET_HEAD_FZF_OPTS | | gcf | FORGIT_CHECKOUT_FILE_GIT_OPTS | FORGIT_CHECKOUT_FILE_FZF_OPTS | | gcff | FORGIT_SHOW_GIT_OPTS<br>`FORGIT_CHECKOUT_FILE_GIT_OP

View on GitHub
GitHub Stars4.9k
CategoryDevelopment
Updated57m ago
Forks156

Languages

Shell

Security Score

100/100

Audited on Mar 21, 2026

No findings