lazygit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLazygit
Lazygit
Lazygit is a TUI for Git. It makes complex operations (interactive rebase, partial staging) accessible via intuitive keyboard shortcuts.
Lazygit 是一款面向Git的TUI(终端用户界面)工具。它通过直观的键盘快捷键,让复杂的Git操作(如交互式变基、部分暂存)变得易于操作。
When to Use
使用场景
- Staging: Staging individual lines/hunks ().
Space - Rebasing: Drag-and-drop commits to reorder them (via keybindings).
- Conflict Resolution: A clear 3-way view to pick "Ours" or "Theirs".
- 暂存:暂存单独的代码行/代码块(按键)。
Space - 变基:通过快捷键拖放提交记录来重新排序。
- 冲突解决:清晰的三方对比视图,可选择“我方版本”或“对方版本”。
Core Concepts
核心概念
Panels
面板
Status, Files, Local Branches, Commits, Stash. Navigate with or arrows.
h/l状态、文件、本地分支、提交记录、暂存区面板。可通过键或方向键切换。
h/lKeybindings
快捷键
- : Commit
c - : Push
P - : Pull
p - : Stage
s
- : 提交
c - : 推送
P - : 拉取
p - : 暂存
s
Custom Commands
自定义命令
Define custom actions in (e.g. "Create PR").
config.yml可在中定义自定义操作(例如“创建PR”)。
config.ymlBest Practices (2025)
2025年最佳实践
Do:
- Interactive Rebase: Press on a past commit to fix it up.
i - Filter: Press to filter branches or files.
/ - Bisect: Use the built-in bisect wizard to find bugs.
Don't:
- Don't fear the CLI: Lazygit is a wrapper. Understanding underlying git concepts is still needed.
建议做法:
- 交互式变基:在历史提交记录上按键来修正提交。
i - 筛选:按键筛选分支或文件。
/ - 二分查找:使用内置的二分查找向导定位bug。
不建议做法:
- 不要畏惧CLI:Lazygit只是Git的一个封装工具,仍需理解Git的底层概念。