# Lazygit — Simple Terminal UI for Git Commands > Lazygit is a simple terminal UI for git commands. Stage files, commit, push, rebase, cherry-pick, squash, and browse history without memorizing 30 git commands. Written in Go and designed for speed with vim-style keybindings. ## Install Save as a script file and run: ## Quick Use ```bash # Install brew install lazygit # macOS sudo apt install lazygit # Debian/Ubuntu (PPA or GH) scoop install lazygit # Windows go install github.com/jesseduffield/lazygit@latest # Launch in any git repo lazygit ``` Essential keybindings: - `space` — stage/unstage file - `c` — commit - `P` — push - `p` — pull - `b` — branches panel - `r` — rebase onto - `m` — merge - `z` — undo - `?` — help menu ## Intro Lazygit is a simple terminal UI for git commands written by Jesse Duffield in Go. Replaces the dozens of git command-line verbs with an intuitive TUI: panels for files, branches, commits, stashes, and remotes. Built on gocui with vim-like navigation. - **Repo**: https://github.com/jesseduffield/lazygit - **Stars**: 76K+ - **Language**: Go - **License**: MIT ## What Lazygit Does - **Staging** — stage/unstage files, hunks, or lines interactively - **Commits** — amend, squash, fixup, reword, edit messages - **Branches** — create, checkout, delete, rebase, fast-forward - **Merges/rebases** — visual conflict resolution - **Stashes** — save, apply, drop with previews - **Cherry-picking** — visual across any commits - **Interactive rebase** — move/drop/squash commits in a TUI - **Search** — within the log - **Custom commands** — define your own shortcuts ## Architecture Go binary + gocui TUI library. Wraps `git` commands under the hood — the TUI just orchestrates them. Works in any git repo, no special setup needed. ## Self-Hosting CLI tool. ## Key Features - Interactive staging by hunk or line - Visual rebase and cherry-pick - Conflict resolution helper - Stash management - Command log (see what git commands ran) - Custom commands - Themes - Git LFS, submodules, worktrees - Easy undo with `z` ## Comparison | Tool | Type | Speed | Scope | |---|---|---|---| | Lazygit | TUI | Fast | Full git | | tig | TUI | Fast | History-focused | | gitui | TUI (Rust) | Fastest | Full git | | git CLI | CLI | Fast | Full git | | GitKraken | GUI | Slow | Full git | | Sourcetree | GUI | Slow | Full git | ## 常见问题 FAQ **Q: 比命令行快在哪?** A: 复杂操作(interactive rebase、hunk staging、cherry-pick 多个 commit)用 TUI 点选远快于输命令。 **Q: 能看 git 执行了什么吗?** A: 按 `p` 进入 log 面板,右下角有实时 command log,能看到每步实际跑的 git 命令。 **Q: Merge conflict 怎么处理?** A: Lazygit 会显示冲突文件,按 `enter` 进入可视化冲突解决器(选择 ours/theirs/both)。 ## 来源与致谢 Sources - GitHub: https://github.com/jesseduffield/lazygit - License: MIT --- Source: https://tokrepo.com/en/workflows/6ed075de-35cb-11f1-9bc6-00163e2b0d79 Author: Script Depot