TiloBox
Back to directory
lazygit project preview

lazygit

A terminal interface for staging, committing, rebasing, cherry-picking, browsing, and managing Git repositories.

LicenseMIT
GitHub stars81.6k
Last commit1 weeks ago
Tags7 topics
GoGitProductivityOpen SourceVersion ControlDeveloper ToolsTerminal Ui
Overview

Why consider lazygit?

lazygit is an open-source terminal user interface for Git commands built in Go. It allows developers to stage files, manage branches, resolve conflicts, and run interactive rebases with keyboard shortcuts.

Guided learning

Learn lazygit by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

4 min read 2 sections
In this guide2 sections

Terminal Git Management with lazygit

Navigating Git branches, diffs, and staging areas through standard command-line flags can become tedious in large codebases. According to the project documentation, Default path for the global config file: - Linux: ~/.config/lazygit/config.yml - MacOS: ~/Library/Application\ Support/lazygit/config.yml. This setup allows terminal users to quickly customize layout styles, color schemes, and keybindings across their preferred workstation environment without depending on heavy graphical user interfaces.

For team repositories that require shared conventions, lazygit also supports localized repository configurations. As noted in the documentation, In addition to the global config file you can create repo-specific config files in <repo>/.git/lazygit.yml. This feature guarantees that team-specific commands or custom diff viewers can be committed or shared locally across development environments without interfering with global personal defaults.

Interactive Commit Workflows and Fixup Commits

When collaborating on pull requests, managing a clean commit history often requires creating fixups rather than squashing prematurely. In lazygit, in the Commits view, select the commit that you want to create a fixup for, and press shift-F. This generates a designated fixup commit with the appropriate subject line prefix, keeping reviewer feedback transparent until the final rebase before merge.

Undoing mistakes during branch manipulation is another critical capability handled natively. As explained in the documentation, You can undo the last action by pressing 'z' and redo with 'Z' (shift+z). This single-key convenience allows developers to walk back mistaken branch checkouts or commits effortlessly.

It is essential to understand the architectural scope and limitations of the built-in undo system. Specifically, Undo uses the reflog which is specific to commits and branches so we can't undo changes to the working tree or stash. By leveraging Git's underlying reflog, the interface reconstructs previous repository states safely without risking unexpected modifications to untracked working directory files.

Custom Command Keybindings Configuration

Developers with specific tooling requirements can extend the interface with tailored shortcuts and menus. As described in the documentation, Custom command keybindings will appear alongside inbuilt keybindings when you view the keybindings menu by pressing '?'. These additions integrate directly into the interactive help interface, making external scripts and tools immediately discoverable.

According to the documentation, You can add custom command keybindings in your config.yml (accessible by pressing 'e' on the status panel from within lazygit) to streamline repetitive operations. Below is the official example demonstrating this configuration structure:

yml
1customCommands:
2 - key: '<c-r>'
3 context: 'commits'
4 command: 'hub browse -- "commit/{{.SelectedLocalCommit.Hash}}"'
5 - key: 'a'
6 context: 'files'
7 command: "git {{if .SelectedFile.HasUnstagedChanges}} add {{else}} reset {{end}} {{.SelectedFile.Name | quote}}"
8 description: 'Toggle file staged'
9 - key: 'C'
10 context: 'global'
11 command: "git commit"
12 output: terminal
13 - key: 'n'
14 context: 'localBranches'
15 prompts:
16 - type: 'menu'
17 title: 'What kind of branch is it?'
18 key: 'BranchType'
19 options:
20 - name: 'feature'
21 description: 'a feature branch'
22 value: 'feature'
23 - name: 'hotfix'
24 description: 'a hotfix branch'
25 value: 'hotfix'
26 - name: 'release'
27 description: 'a release branch'
28 value: 'release'
29 - type: 'input'
30 title: 'What is the new branch name?'
31 key: 'BranchName'
32 initialValue: ''
33 command: "git flow {{.Form.BranchType}} start {{.Form.BranchName}}"
34 loadingText: 'Creating branch'

Official release distributions and pre-built binaries across operating systems are tracked at the v0.64.1 release page, while community discussions and issue tracking take place at the main lazygit repository where Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files under standard open-source distribution terms.

Related tools

More options with a similar category or technology profile.

lazygit FAQs

lazygit is listed as a Developer Tools tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

lazygit is listed under the MIT license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

lazygit is listed as an alternative to GitHub Desktop. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.