Skip to content
>_devvkit
$devvkit learn --librarie lazygit-&-lazydocker-guide

lazygit & lazydocker Guide

[git][docker][tui][productivity]
Dev Productivity
Install
# lazygit:
brew install lazygit
sudo apt install lazygit
# or: go install github.com/jesseduffield/lazygit@latest

# lazydocker:
brew install lazydocker
go install github.com/jesseduffield/lazydocker@latest

lazygit is a terminal UI for git. Press 1-5 to switch panels (status, files, branches, commits, stash). Stage files with space, commit with c, push with P, branch with b, diff with d. The blame panel (g b) shows line-by-line annotations.

lazydocker manages Docker from the terminal. Panels: containers (start/stop/logs/exec), images (remove/prune), volumes, and docker-compose services. Press s to toggle services, l for logs, e to exec into a container.

Both tools use vim-style keybindings by default. Customize in ~/.config/lazygit/config.yml. The lazygit interactive rebase (r) is the best way to squash, reorder, or edit commits. GUI alternatives: GitKraken, SourceTree, Docker Desktop.

lazygit Basics

Launch lazygitStart in repo directory.
cd my-project
lazygit

# Run from anywhere:
lazygit --path ~/projects/myapp
lazygit --work-tree /app --git-dir /app/.git
lazygit key shortcutsEssential keys.
# Panels: 1=Status 2=Files 3=Branches 4=Commits 5=Stash
# Files: space=stage c=commit d=diff s=stash D=reset
# Branches: n=new M=merge space=checkout r=rebase
# Commits: g=reset n=amend s=squash

lazygit Advanced

Interactive rebaseSquash, reorder, edit.
# Press r on a branch to start interactive rebase
# In rebase panel:
# p: pick  r: reword  e: edit  s: squash  f: fixup  d: drop

# Great for: cleaning up WIP commits before push
# Press undo if you make a mistake!
lazygit custom commandsExtend with custom actions.
# ~/.config/lazygit/config.yml
customCommands:
  - key: "C"
    command: "git cz"
    context: "files"
    description: "Commit with Commitizen"
  - key: "F"
    command: "git fixup"
    context: "commits"
    description: "Fixup commit"

lazydocker

Launch lazydockerStart Docker TUI.
lazydocker

# Connect to remote Docker:
lazydocker --host tcp://192.168.1.10:2375

# Custom compose file:
lazydocker --compose-file docker-compose.prod.yml
lazydocker key shortcutsContainer management.
# Panels: Containers | Images | Volumes | Services
# s: start/stop  r: restart  l: logs  e: exec shell
# d: remove container  [ / ]: prev/next tab

# Images: d=remove  p=prune unused  space=pull latest
# Great for: monitoring multi-service dev environments