Skip to main content

Lazygit

🌳 Easier Git with Lazygit 0/2

See more project context at a glance:

  • your changed files and their diffs
  • your local and remote branches and how many commits each has to pull/push
  • recent commits and their diffs

Execute git commands with single key presses:

  • space to stage/unstage a specific file
  • a to stage/unstage all changed files
  • D to discard all changes
  • d to discard changes to the selected file
  • enter on a file to move into view that allows you to stage/unstage lines and hunks with space and ?
  • enter on a branch to see its commits and their diffs
  • enter on a commit to see its changed files and their diffs
  • ? to copy a commit from one branch + ? to paste it on another (I.e. Cherry-picking as a familiar copy/paste action)
  • f to fetch changes from an upstream branch (e.g. main) + M to merge them into the currently checked out branch (e.g. your-feature-in-progress)
  • a to amend a commit by adding the currently staged changes to it
  • r to reword a commit message or branch name
  • p to pull
  • P to push

Want to stage or unstage the changes in the selected file, hunk or line? Press space. Discard them? Press d.

Want to stage all your changes? Press a. Discard them? Press D.

Complete multistep git workflows visually

  • Cherry-pick
  • Merge conflicts

Discover what git actions are possible

  • While selecting any item (e.g. a file, diff line/hunk, branch, commit), pressing ? will show a searchable menu of relevant commands and what each does

Example workflows

1. Commit changes to a file

  1. space to stage the file
  2. c to open the commit message input
  3. enter to commit with the given message

Add screencast?

2.

  • GitHub - jesseduffield/lazygit: simple terminal UI for git commands
  • git: inline diffs with —word-diff! (intermediate) anthony explains

Why

  • Using CLI, hard to remember all commands (no hints available)
  • Using VS Code, hard to use keyboard for everything (especially complicated workflows)
  • Lazygit is a TUI that makes git workflows easy to complete with quick keypresses

General

Updating feature branch with latest upstream branch

  1. Move to branches area
  2. If your feature branch isn’t already checked out, move to it and press Space to check it out
  3. Move to the local copy of your upstream branch (e.g. main)
  4. Press f to fast-forward it to match its upstream (e.g. your local main now matches the remote main)
  5. Press M to merge the local copy of your upstream branch into your checked out branch (or r to rebase your checked out branch onto it if you prefer)

Splitting an existing commit into multiple commits

Inbox