LinuxCommandLibrary

lazygit

Manage Git repositories within a terminal UI

TLDR

Open Lazygit in the current repository

$ lazygit
copy

Open Lazygit for a specific Git repository
$ lazygit --path [path/to/repository]
copy

Start Lazygit with focus on a specific panel
$ lazygit [status|branch|log|stash|...]
copy

Print the default Lazygit configuration
$ lazygit --config
copy

Tail the Lazygit logs (useful with debug mode in another terminal)
$ lazygit --logs
copy

Run Lazygit in debug mode
$ lazygit --debug
copy

Print the configuration directory
$ lazygit --print-config-dir
copy

SYNOPSIS

lazygit [options]

PARAMETERS

-h, --help
    Display help information for the command.

--version
    Show the current version of lazygit.

--config path
    Specify a custom path for the configuration file (defaults to ~/.config/lazygit/config.yml).

--debug
    Enable debug logging, which outputs detailed messages to the log file.

--git-dir path
    Set the path to the Git repository directory (e.g., '.git').

--logfile path
    Specify a custom path for the log file (defaults to ~/.config/lazygit/logs/lazygit.log).

--work-tree path
    Set the path to the Git working tree directory (e.g., '.').

DESCRIPTION

lazygit is a popular terminal-based user interface (TUI) for Git, designed to simplify complex Git operations and provide a visual overview of your repository's status. It allows users to manage Git workflows directly from the command line, leveraging an interactive, curses-like interface.

With lazygit, you can effortlessly perform common Git actions such as adding, committing, pushing, pulling, rebasing, merging, and stashing changes. It presents different aspects of your repository—like files, branches, commits, and stashes—in distinct panels, making it easy to navigate and interact with your Git history. Its keyboard-driven approach aims to increase efficiency by minimizing context switching and providing quick access to powerful Git features. It's written in Go and supports various platforms.

CAVEATS

lazygit relies on the underlying git command-line tool being installed and properly configured. While highly intuitive, its keyboard-driven interface can have a slight learning curve for users accustomed to mouse-centric GUIs. Although it covers most common Git operations, very complex or obscure Git commands might still require dropping back to the pure git CLI, though lazygit often provides a convenient way to do so.

KEYBINDINGS

lazygit is heavily reliant on keybindings for navigation and operation. Users can customize these keybindings extensively through its configuration file to suit their preferences and workflows, making it incredibly efficient for power users.

CONFIGURATION

The command is highly customizable via a YAML configuration file, typically located at ~/.config/lazygit/config.yml. This file allows users to modify themes, layout, keybindings, and even define custom commands and aliases, tailoring the experience to their specific needs.

HISTORY

Created by Jesse Duffield (jesseduffield), lazygit quickly gained popularity after its initial releases around 2018-2019. Developed in Go, it was designed to provide a more intuitive and visually appealing way to interact with Git in the terminal than traditional command-line interfaces. Its active development and strong community contributions have cemented its place as a go-to tool for many developers.

SEE ALSO

git(1), tig(1), tmux(1), screen(1)

Copied to clipboard