README.md

August 2, 2026 · View on GitHub

███████╗ ██████╗ ██████╗  ██████╗ ██╗████████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██║╚══██╔══╝
█████╗  ██║   ██║██████╔╝██║  ███╗██║   ██║   
██╔══╝  ██║   ██║██╔══██╗██║   ██║██║   ██║   
██║     ╚██████╔╝██║  ██║╚██████╔╝██║   ██║   
╚═╝      ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚═╝   ╚═╝   
                                              

License: MIT zshrs plugin

[INTERACTIVE GIT + FZF — COMPILED]

"git add, log, diff, stash — native builtins, not sourced functions."

[NATIVE ZSHRS PLUGIN]

forgit — the interactive git + fzf utility — ported to a native zshrs plugin. Instead of shell functions parsed on every startup, the commands are compiled Rust builtins in a cdylib loaded through zshrs's stable plugin ABI with zmodload -R.

zshrs · znative · upstream


Table of Contents


[0x00] OVERVIEW

ga, glo, gd, … the whole forgit command set, running as native machine code with no per-startup sourcing. Orchestration, argument handling, and sequencing are Rust; git and fzf run as subprocesses exactly as upstream.

Requires git and fzf on PATH (same runtime deps as upstream forgit). Diffs are rendered through whatever pager you configure — $FORGIT_PAGER, else git config core.pager, else cat — so pointing that at delta or diff-so-fancy works, but neither is auto-detected.


[0x01] INSTALL

znative load MenkeTechnologies/zshrs-forgit

Put that one line in your .zshrc. znative, zshrs's package manager, installs the plugin on the first shell start — clones it, runs cargo build --release, and zmodload -Rs the resulting libforgit — then loads it from the store, zero-network, on every start after. No separate install step.

Manual build

cargo build --release
zmodload -R ./target/release/libforgit.dylib   # .so on Linux
ga

[0x02] COMMANDS

aliaswhat it does
gainteractive git add
grhunstage files (git reset HEAD)
glocommit log viewer
gddiff viewer
gcfcheckout / restore modified files
gcleangit clean selector
gssstash viewer
gcpcherry-pick selector
gi.gitignore template generator

Environment

variableeffect
FORGIT_PAGERpager for all diff output; falls back to git config core.pager, then cat
FORGIT_SHOW_PAGERpager for git show; falls back to git config pager.show, then $FORGIT_PAGER
FORGIT_DIFF_PAGERpager for git diff; falls back to git config pager.diff, then $FORGIT_PAGER
FORGIT_FZF_DEFAULT_OPTSappended to the built-in fzf option block (after $FZF_DEFAULT_OPTS)
FORGIT_COPY_CMDcommand used to copy a selection to the clipboard
FORGIT_GI_REPO_REMOTE.gitignore template repo URL used by gi
FORGIT_GI_REPO_LOCALlocal clone path for that template repo
FORGIT_GI_TEMPLATESsubdirectories inside the template repo to search

[0x03] HOW IT WAS PORTED

A worked example for the zshrs plugin porting guide: docs/PORTING_ZSH_PLUGIN.md. Orchestration, argument handling, and sequencing are Rust; git/fzf run as subprocesses; fzf --preview strings stay shell (fzf runs them via sh).


[0xFF] LICENSE

MIT. Ported from wfxr/forgit (MIT). See LICENSE.