DevOps
Terminal Git UI Tools Guide
Explore terminal-based Git UI tools like lazygit and tig that bring visual Git operations right into your terminal.
- Developers using Git in CI/CD pipelines and IDE integrations
- Readers who want to understand Git operation boundaries in automation
- Basic understanding of branch, commit, and push
- Basic CI/CD concepts
- Misusing GITHUB_TOKEN causing security issues
- Not understanding the trade-off between shallow and partial clone
- Relying on IDE operations without understanding underlying Git behavior
What you will learn
- Understand the core purpose of Terminal Git UI Tools Guide
- Master the basic usage and common options of Terminal Git UI Tools Guide
- Explore terminal-based Git UI tools like lazygit and tig that bring visual Git operations right into your terminal.
- Understand key concepts: Overview
- Know when to use this feature and when to avoid it
Start with a problem
Your team is adopting CI/CD pipelines, or you're configuring Git integration in your IDE — but you're unsure how Git behaves differently in automated environments compared to local manual operations.
Overview
Terminal Git UI tools bring visual Git operations into your terminal without switching to a separate GUI application. They combine terminal speed with visual convenience.
lazygit
lazygit is one of the most popular terminal Git UIs, written in Go and available on all major platforms.
Installation
# macOS
brew install lazygit
# Linux (Debian/Ubuntu)
sudo add-apt-repository ppa:lazygit-team/release
sudo apt-get update
sudo apt-get install lazygit
# Launch
lazygit
Core Features
| Feature | Key | Description |
|---|---|---|
| Stage/Unstage | Space | Toggle file stage state |
| Commit | c | Create commit |
| Switch branch | b | View and switch branches |
| Merge | m | Merge into current branch |
| Rebase | r | Interactive rebase |
| Stash | s | Stash changes |
| Push | P | Push to remote |
| Log | l | View commit log |
| Diff | Enter | View file diff |
Typical Workflow
cd my-project
lazygit
# Main panels (navigate with left/right arrows):
# - Status
# - Files
# - Branches
# - Commits
# - Stash
tig
tig is an ncurses-based text-mode interface for Git, focused on efficient log viewing and diff browsing.
Installation
# macOS
brew install tig
# Linux
apt-get install tig
Core Commands
tig # Commit log view
tig log --oneline # Compact log
tig diff # Diff view
tig blame file.js # Blame view
tig status # Status view
Shortcuts
| Key | Function |
|---|---|
j/k | Move up/down |
Enter | View selected commit |
/ | Search |
m | View branch refs |
t | Toggle tree view |
Choosing a Tool
| Need | Recommended |
|---|---|
| Daily commit and stage | lazygit |
| Browsing history and diff | tig |
| Interactive rebase | lazygit |
| Blame tracking | tig |
| Full GUI experience | lazygit |
Notes
- Terminal UI tools invoke Git commands under the hood — they don't change Git's behavior
- Understanding the underlying commands is recommended before relying on UI tools
- Conflict resolution still requires understanding Git's merge mechanism
Try it yourself
- Practice the terminal-git-ui command in a test repository and observe state changes before and after
- Experiment with different options and compare the output differences
- Simulate a real scenario where you would need to use this, and walk through the full process
Continue Learning
ide/github-desktop— GitHub Desktop guideide/vscode-git— Git in VS Codecommands/git-log— git log command reference