This open-source Linux app bought me to ditch the git command

This lovely Linux terminal app will make it easier to ditch the git command line for good. Its responsive structure and keyboard interface assist to deal with the problem of even complicated git instructions.
Lazygit is a TUI for Git
Think of GitHub Desktop, however within the terminal (and higher)
Lazygit is a software designed to ease your day-to-day git use. The git command-line program is definitely worth learning, however it’s extremely complicated. It could provide an enormous variety of options, however you in all probability solely use a tiny subset of them. Even so, it may be exhausting to recollect these instructions which are important but uncommon, like bisect or stash.
Like many trendy apps for the command line, Lazygit has a multi-line textual content interface to approximate a GUI. It’s a compromise between the sparse minimalism of git and the mouse-driven, totally graphical interfaces of tools like GitKraken and SourceTree. In truth, the general structure might be acquainted when you’re a person of the GitHub Desktop app.
Lazygit enables you to do all of the fundamentals utilizing the keyboard, from stashing and committing to switching branches or testing new worktrees. Basic mouse assist is on the market, too, however the nature of the TUI signifies that keyboard navigation is fast and straightforward.
How to put in and use Lazygit
An excellent-quick course of
You can set up Lazygit utilizing your distribution’s bundle supervisor: sudo apt set up lazygit on present Debian/Ubuntu, or brew set up lazygit on macOS. Package managers are supported for a lot of different programs; check the project’s README for additional particulars.
Once put in, merely run lazygit from a checked-out repository. You ought to see an interface much like this:
Lazygit makes use of an adaptive structure, so you may resize your terminal window, and particular person panels will regulate accordingly.
Each of the primary panels is labeled with a quantity from 0 to five. Press one in all these keys to activate the corresponding panel. Some panels current completely different tabs, and you may change between these tabs within the energetic panel utilizing [ (left bracket) and ] (proper bracket).
Lazygit helps completely different layouts, so you may concentrate on a selected panel or present extra panels directly. Pressing + cycles via these layouts, guaranteeing that the energetic panel stays seen. For instance, increasing the third panel when displaying tags gives a two-column view, with the tag panel on the left and particulars about that particular tag on the correct:
Pressing + once more will present a single, full-sized panel itemizing all tags:
In this view, you may nonetheless press 0 to change to the element panel, or the shortcut for another panel to change to it as an alternative. This flexibility means you can rapidly adapt Lazygit to whichever structure you favor to your job. This is a bit like utilizing a tiling window manager and, when you’ve ever used one earlier than, you’ll admire how a lot quicker it may be to regulate structure utilizing the keyboard.
These Lazygit options actually stand out
Change does not should be exhausting
Like many TUIs, Lazygit has glorious assist for mouse management. Simply click on someplace on display, and the app will normally behave as you’d anticipate, switching panels and tabs, deciding on particular person gadgets from lists, and paging via lengthy lists. A mouse click on may even open the 2 ever-present hyperlinks within the app’s footer to donate or ask a assist query. You may even use a scroll wheel to maneuver via lengthy lists, too.
Lazygit’s commit graph presents a pleasant view of branches and merges, utilizing easy line drawing to symbolize them, in the same approach to GUIs like Fork or GitKraken. The view additionally color-codes by writer, making it simple to trace down who did what:
Lazygit gives fundamental textboxes so that you can enter issues like commit messages. But it additionally enables you to change to your editor to jot down such messages in a extra acquainted, featureful surroundings:
You may even use this characteristic to edit recordsdata instantly from Lazygit, turning it into an IDE of types.
The characteristic that I believe I’ve discovered most helpful, thus far, is selective staging. This is nice when, like me, you are inclined to make plenty of distinct modifications directly. When it involves committing, it helps to pick out related modifications from a file and ignore others, in the interim. You can do that actually simply with Lazygit by following these steps:
- In the Files panel, choose the file you want to stage and press Enter, which can focus the “Unstaged modifications” panel on the correct.
- Move the cursor up/down to pick out particular person traces and stage them with house.
- Press a to pick out entire hunks directly, then Space to stage them.
- Once you’re completely satisfied, press Escape to return to the Files panel and c to commit your modifications.
Trust within the course of
It takes a little bit of effort and time to be taught Lazygit’s keyboard shortcuts, though assistance is all the time available. Beginners ought to discover it a lot simpler to familiarize yourself with than a few of Git’s obscure command-line choices, and specialists will be glad about the time saved throughout commonly-repeated duties.
