laziergit

command module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

laziergit

lazygit's power, as a native Mac app. Not Electron, not a webview, not a terminal: drawn on the GPU by MyGo, on top of lazygit's own git engine.

lazygit's git layer (pkg/commands) is imported as a Go library, so what the app does to your repository is lazygit's, tested by its many users: the loaders, staging, interactive rebase through lazygit's daemon, push and pull with credential prompts, undo through the reflog. Only the interface is new, and it is a Mac app's: the mouse and the keyboard both work, with lazygit's keys.

Choosing commits with the mouse, copying them, cherry-picking them onto a release branch, and staging a single line

Line staging Settings
The diff of a file, line by line, with lines to stage chosen The Settings window

Install

With Homebrew, on macOS 12 or later:

brew install Siemko/tap/laziergit
laziergit            # in a repository, or:
ln -sf "$(brew --prefix)/opt/laziergit/laziergit.app" /Applications/laziergit.app

brew upgrade laziergit updates it. A copy from a release's disk image updates itself: it checks for a new version once a day, and laziergit → Check for Updates… checks now.

With Go 1.27.3+ (a laziergit command, without the app bundle):

go install github.com/Siemko/laziergit@latest

The app isn't signed with a Developer ID yet, so macOS refuses to open the app of a disk image from the releases downloaded with a browser. Homebrew and go install don't mark what they install as downloaded, so neither is refused. To use a disk image anyway, check it against the release's SHA256SUMS first (shasum -a 256 -c SHA256SUMS --ignore-missing), and only then clear the mark of the app you copied: xattr -dr com.apple.quarantine /Applications/laziergit.app.

Run from source

Requires Go 1.27.3+.

go run . [path/to/repo…]      # or: go tool mygo dev
go test ./...                 # the UI tests run headless, without a window
go tool mygo build            # build/darwin-arm64/laziergit.app and a .dmg

LAZIERGIT_SNAPSHOTS=<dir> go test ./internal/app saves PNGs of the views the tests drive. scripts/media.sh makes the README's pictures and the demo, from a copy of this repository, drawn by the app (it needs ffmpeg). LAZIERGIT_PERF_REPO=<repo> with go test -run 'TestLoadTimes|TestFrameTimes' -v ./internal/... times a load and the window's frames in a large repository. LAZIERGIT_CAPTURE=<file.png> (with an optional LAZIERGIT_CAPTURE_SECTION=history) makes the app save a picture of its window, then quit.

What works

Area
Changes file list with status, stage/unstage a file or everything, discard, commit (summary and description), amend
Staging lazygit's line staging: the file's diff line by line, syntax highlighted; choose lines (click, ⇧-click, j/k, J/K, v range, a hunk) and stage, unstage or discard them (space, d), or a whole hunk from its header; tab switches between the staged and unstaged sides
History the latest 300 commits, with lazygit's graph drawn as curves, branch and tag chips, pushed/unpushed state; commit files and per-file diff; reword, fixup, move up/down, drop (interactive rebase); a range of commits (⇧-click, ⌘-click, a drag over the rows, J/K, ⇧↑/⇧↓, v range; esc lets go) to fix up, move, drop or copy at once, from the bar under the list or the keys; a double click rewords; continue/abort banner; t tags a commit
Conflicts each conflict as a card of its current, base (diff3) and incoming sides, highlighted, the lines between folded; keep a side, both, or every conflict's one side (space, b, j/k, ←/→), undo (z); the file is staged once resolved, and the app offers to continue; Abort / Skip / Continue for merges, rebases, cherry-picks and reverts, started in the app or not
Branches checkout, new, merge, rebase onto, delete; upstream ahead/behind; each branch's commits, with their graph
Remote branches each remote's branches (9, or the remote in the sidebar): check out as a local branch tracking it, new branch from it, merge, rebase onto, delete on the remote, fetch the remote; their commits
Tags list, new (lightweight, or annotated with a message), check out, push to a remote, delete (5); their commits
Reflog HEAD's reflog (6): each entry's commit, files and diff; check out, new branch, copy to cherry-pick, reset soft, mixed or hard to it
Worktrees list, new (a new branch or an existing one), open in a window of its own, remove (7)
Submodules list with their state, add, initialize and update one or all, open in a window of its own, remove (8)
Cherry-pick copy commits from any branch's log, a tag's, the reflog or the history (C), paste them onto the current branch (V), conflicts resolved as a merge's; the windows of a repository and of its worktrees share the commits copied, so a commit copied in one worktree pastes in another
Undo / redo lazygit's reflog undo (z, Z), interoperable with lazygit's: commits, resets, pulls, checkouts and rebases, and also cherry-picks, reverts and merges; a hard reset stashes local changes around it
Stash stash all, pop, apply, drop; files and diff
Remotes fetch, pull, push (sets the upstream on first push), force-push with lease; username/password/passphrase prompts
Windows a window per repository (⌘N, ⌘O, File → Open Recent, the Window menu); opening one already open brings its window to the front; laziergit <path> from a terminal opens it in the app running; the windows of the last session open again; each window keeps its place
Settings a Settings window (⌘,, or the gear under the sidebar): theme, the status bar's key hints and the sidebar's shortcuts, reopening the last session, the diffs' layout and context lines, how many commits History loads, fetching in the background, asking before a push, signing off commits, the main branches; every window follows them at once
App vibrant sidebar, ⌘K command palette, lazygit's single-key bindings (1–9, j/k, space, a, c, d, r, f, p, P, s, g, n, M, ⌃j/⌃k), status-bar key hints, context menus, toasts, command log (⌘L), auto-refresh on disk changes, light and dark

Layout

tools/genicon       draws resources/icon.png
scripts/            the third-party notices, the Homebrew formula of a release, the README's media
docs/images/        the README's pictures, made by scripts/media.sh
main.go             startup: lazygit's rebase daemon, the login shell's PATH, a single instance
windows.go          the windows, their menus, recent repositories and the session
internal/core       a thin adapter over lazygit's GitCommand: Open, Load (a Snapshot), actions
internal/core/graph lazygit's commit-graph layout, kept as geometry (its pipes are unexported upstream)
internal/app        the MyGo views: sidebar, lists, diffs, dialogs, the action registry

Every command is declared once, in internal/app/actions.go. The palette, the keyboard shortcuts and the status-bar hints all come from that registry.

Not yet

These are from lazygit, still to port:

  • custom patches
  • bisect
  • custom commands
  • filtering and diffing modes

Limitations:

  • lazygit assumes one repository per process: it changes the working directory and git's environment, and some of its file operations go by relative paths. Windows' repositories take turns (core.Repo.enter), so a long push in one window holds back the others' git commands until it ends.
  • It uses lazygit's config format, kept in ~/Library/Application Support/laziergit, beside the app's own settings.json, whose settings take the place of config.yml's same ones.

Started from Finder or the Dock, the app takes its PATH from your login shell, so that git finds Homebrew's tools (gpg, git-lfs, credential helpers) and hooks find theirs. LAZIERGIT_DEBUG=1 logs what the windows do.

Releasing

Bump version in mygo.json, add the version's section to CHANGELOG.md (its release notes, which the app shows as it offers the update), run scripts/notices.sh, commit, and push the tag v<version>: the release workflow tests, builds and publishes the app. Then scripts/formula.sh <version> prints the tap's formula.

Installed apps accept only updates signed with the key whose public half is mygo.json's updates.publicKey. The secret half is the repository's MYGO_UPDATER_PRIVATE_KEY secret, which the release workflow signs with; its copy is in ~/Library/Application Support/mygo/update-keys. Keep a copy in a password manager: without it, installed apps can't be updated again.

License

MIT. The modules laziergit includes are under their own licenses, collected in resources/THIRD_PARTY_NOTICES.md.

Documentation

Overview

laziergit is lazygit's functionality in a native desktop app.

go tool mygo dev            # or: go run . [repository…]

Directories

Path Synopsis
internal
app
Package app is laziergit's window: lazygit's functionality, through package core, in MyGo's native UI.
Package app is laziergit's window: lazygit's functionality, through package core, in MyGo's native UI.
core
Package core drives a git repository through lazygit's command layer (github.com/jesseduffield/lazygit/pkg/commands), for a UI to show and act on.
Package core drives a git repository through lazygit's command layer (github.com/jesseduffield/lazygit/pkg/commands), for a UI to show and act on.
tools
genicon command
genicon draws the app's icon, resources/icon.png, with MyGo's renderer: a commit graph as the app draws it, on the rounded square of macOS icons.
genicon draws the app's icon, resources/icon.png, with MyGo's renderer: a commit graph as the app draws it, on the rounded square of macOS icons.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL