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.

Who This Is For
  • Developers using Git in CI/CD pipelines and IDE integrations
  • Readers who want to understand Git operation boundaries in automation
Prerequisites
  • Basic understanding of branch, commit, and push
  • Basic CI/CD concepts
Common Risks
  • 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

FeatureKeyDescription
Stage/UnstageSpaceToggle file stage state
CommitcCreate commit
Switch branchbView and switch branches
MergemMerge into current branch
RebaserInteractive rebase
StashsStash changes
PushPPush to remote
LoglView commit log
DiffEnterView 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

KeyFunction
j/kMove up/down
EnterView selected commit
/Search
mView branch refs
tToggle tree view

Choosing a Tool

NeedRecommended
Daily commit and stagelazygit
Browsing history and difftig
Interactive rebaselazygit
Blame trackingtig
Full GUI experiencelazygit

Notes

  1. Terminal UI tools invoke Git commands under the hood — they don't change Git's behavior
  2. Understanding the underlying commands is recommended before relying on UI tools
  3. Conflict resolution still requires understanding Git's merge mechanism

Try it yourself

  1. Practice the terminal-git-ui command in a test repository and observe state changes before and after
  2. Experiment with different options and compare the output differences
  3. Simulate a real scenario where you would need to use this, and walk through the full process

Continue Learning

  1. ide/github-desktop — GitHub Desktop guide
  2. ide/vscode-git — Git in VS Code
  3. commands/git-log — git log command reference