We use cookies to understand how the site is used and to display ads. Analytics and advertising only run after you accept. You can change your choice anytime. Privacy policy

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 lazygit· Start in repo directory.
cd my-project
lazygit

# Run from anywhere:
lazygit --path ~/projects/myapp
lazygit --work-tree /app --git-dir /app/.git
lazygit key shortcuts· Essential 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 rebase· Squash, 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 commands· Extend 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 lazydocker· Start 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 shortcuts· Container 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