Live data from Hacker News

Lazygit: Simple terminal UI for Git commands

github.com

41–50 of 82 posts

Re: Lazygit: Simple terminal UI for Git commands

#41
post #4

I use IntelliJ IDEA and often rely on their own Git functionality. But it cannot stage specific lines, only whole chunks [1]. For that, I've been using lazygit for a couple of months now. I like its simple UI and that it makes staging specific lines very easy and quick. If you like lazygit, you might also be interested in similar Git CLI clients that I collected here [2]. [1] https://youtrack.jetbrains.com/issue/IDEA…

FWIW, the per line staging functionality in GitUp ( https://gitup.co/ ) is quite easy and straightforward. Very lightweight program that you can open via cli (`gitup` when in a git directory)

MacOS only

Re: Lazygit: Simple terminal UI for Git commands

#42
post #4

I use IntelliJ IDEA and often rely on their own Git functionality. But it cannot stage specific lines, only whole chunks [1]. For that, I've been using lazygit for a couple of months now. I like its simple UI and that it makes staging specific lines very easy and quick. If you like lazygit, you might also be interested in similar Git CLI clients that I collected here [2]. [1] https://youtrack.jetbrains.com/issue/IDEA…

Wow. VS Code can do that.

Re: Lazygit: Simple terminal UI for Git commands

#43
post #4

I use IntelliJ IDEA and often rely on their own Git functionality. But it cannot stage specific lines, only whole chunks [1]. For that, I've been using lazygit for a couple of months now. I like its simple UI and that it makes staging specific lines very easy and quick. If you like lazygit, you might also be interested in similar Git CLI clients that I collected here [2]. [1] https://youtrack.jetbrains.com/issue/IDEA…

Unless I'm misunderstanding your comment, this feature is actually included in the latest EAP/beta releases[1]. There is discussion of it at the bottom of the issue you linked.

[1] https://blog.jetbrains.com/idea/2023/06/intellij-idea-2023-2...

Re: Lazygit: Simple terminal UI for Git commands

#44

I found lazygit after building something of my own thay solves some of these problems for me - git-fuzzy [0]. I'd like to share some of my thoughts about the comparison. lazygit is a TUI for git which can behave in a standalone fashion. It's also designed to be quick and easy to use to perform quite advanced actions but ones that a seasoned git user may really want when working with git history. Since I'm already a s…

Interesting project... in the hopes of maybe nerd-sniping you (or having someone tell me where it already exists), I'll tell you the story I'd really like a solution to but can never seem to find time to build:

I have 5 un-pushed commits. I missed a 1-line change to that first one. I add that one line change to staging (gitui/lazygit/whatever), then I want to `git commit --fixup=COMMIT`. Finding that COMMIT is always a manual process for me for two reasons.

First I have to find the commit to which it applies. This commit is almost always the commit that changed the same line, or added lines around it, or something similar. I guess you could say it's the commit with the closest proximity to the change I'm adding.

Second I have to find the hash of that commit. If I've since done something like an autosquash rebase then it'll have changed. I generally end up using the mouse to do a copy/paste at this point.

Why not skip the fixup commits and just rebase right then, you might ask. Well the commits are signed, and signing requires tapping my yubikey for each commit after that.

I would really like to be able to do something like `git commit --I'm-an-idiot-and-missed-this-so-please-apply-a-fixup-to-the-proper-commit`, and have it do the figuring out for me.

Re: Lazygit: Simple terminal UI for Git commands

#45

I'm curious how much people prefer TUIs over editor-plugin-GUIs these days. I'm getting more and more persuaded by the plugin model personally - perhaps partly by how easy it is to discover, install, update, uninstall, etc VSCode plugins

Emacs has had this forever...

Re: Lazygit: Simple terminal UI for Git commands

#46
post #44

I found lazygit after building something of my own thay solves some of these problems for me - git-fuzzy [0]. I'd like to share some of my thoughts about the comparison. lazygit is a TUI for git which can behave in a standalone fashion. It's also designed to be quick and easy to use to perform quite advanced actions but ones that a seasoned git user may really want when working with git history. Since I'm already a s…

Interesting project... in the hopes of maybe nerd-sniping you (or having someone tell me where it already exists), I'll tell you the story I'd really like a solution to but can never seem to find time to build: I have 5 un-pushed commits. I missed a 1-line change to that first one. I add that one line change to staging (gitui/lazygit/whatever), then I want to `git commit --fixup=COMMIT`. Finding that COMMIT is always…

I can’t solve the whole problem for you, but you can `git commit --fixup HEAD~4` if you know it’s 5 commits back. No need to figure out the hash. `HEAD^^^^` would also work — sometimes if I have to repeatedly fixup the same commit, adding an additional ^ to a previous command is easiest.

Re: Lazygit: Simple terminal UI for Git commands

#47
post #44

I found lazygit after building something of my own thay solves some of these problems for me - git-fuzzy [0]. I'd like to share some of my thoughts about the comparison. lazygit is a TUI for git which can behave in a standalone fashion. It's also designed to be quick and easy to use to perform quite advanced actions but ones that a seasoned git user may really want when working with git history. Since I'm already a s…

Interesting project... in the hopes of maybe nerd-sniping you (or having someone tell me where it already exists), I'll tell you the story I'd really like a solution to but can never seem to find time to build: I have 5 un-pushed commits. I missed a 1-line change to that first one. I add that one line change to staging (gitui/lazygit/whatever), then I want to `git commit --fixup=COMMIT`. Finding that COMMIT is always…

I usually solve this by commiting my fixup in a dummy commit, then do a rebase -i HEAD~n where n is the number of commits I want to look back at. Then during the rebase I just move my commit below the one that seem the most appropriate and mark it for squash. Execute the rebase. Done

Re: Lazygit: Simple terminal UI for Git commands

#48

I'm curious how much people prefer TUIs over editor-plugin-GUIs these days. I'm getting more and more persuaded by the plugin model personally - perhaps partly by how easy it is to discover, install, update, uninstall, etc VSCode plugins

The state of desktop application is pretty alarming, everything is its own web browser..

I'm glad people still build these TUIs, that's exactly what i need, simple interaction with my keyboard, no fuss, no bloat (edit: just checked, the executable is pretty large ~5mb, I wish Go made some effort in that area), a simple executable that can run on my headless server through SSH

Re: Lazygit: Simple terminal UI for Git commands

#49
post #47
post #44

Earlier quoted context omitted.

Interesting project... in the hopes of maybe nerd-sniping you (or having someone tell me where it already exists), I'll tell you the story I'd really like a solution to but can never seem to find time to build: I have 5 un-pushed commits. I missed a 1-line change to that first one. I add that one line change to staging (gitui/lazygit/whatever), then I want to `git commit --fixup=COMMIT`. Finding that COMMIT is always…

I usually solve this by commiting my fixup in a dummy commit, then do a rebase -i HEAD~n where n is the number of commits I want to look back at. Then during the rebase I just move my commit below the one that seem the most appropriate and mark it for squash. Execute the rebase. Done

Wow, I never realized that changing the order of commits in an interactive rebase was a legit operation.

Thanks for the tip!

Re: Lazygit: Simple terminal UI for Git commands

#50

I'm curious how much people prefer TUIs over editor-plugin-GUIs these days. I'm getting more and more persuaded by the plugin model personally - perhaps partly by how easy it is to discover, install, update, uninstall, etc VSCode plugins

I prefer it, but I also prefer to stick to the terminal as much as possible. If I were a VSCode user, I might disagree.

My main factor is I don't want to have to context switch across applications. I don't feel like I'm doing that if I stay in the terminal. As such, I would imagine if I were a VSCode user, I'd prefer a git plugin there.

VCS is very much tied to the code, so I think it makes sense to co-locate.

Post reply on HN