7/29/2026 at 10:26:44 PM
Magit allows selective staging/unstaging, either of hunks, or by selecting lines (AKA Emacs's "region"). I avoid staging from the git commandline, unless I'm just doing whole files.PS: Majutsu provides this too (a magit-like tool for jj)
by chriswarbo
7/29/2026 at 11:49:47 PM
The per-line staging in magit is a frequent tool I use. I can be in the middle of bunch of other changes, change 1 line for a different reason that would otherwise be "mid-hunk", and the stage & commit it with its own explanation.It releases me from having to have the "discipline" to stay 100% focused on the broader task at hand and say "hmm, I should fix that while I'm here", without co-mingling purposefully different commits.
Truly fantastic. Absurdly, I have no idea how to do this on the command line, though presumably it is possible from there too (just a lot, lot less convenient).
by PaulDavisThe1st
7/30/2026 at 12:50:31 AM
git add -p or git add ‹file› -pby cwillu
7/30/2026 at 2:11:01 AM
Nope. That doesn't offer per-line .. or does it ?by PaulDavisThe1st
7/30/2026 at 2:29:55 AM
e in interactive mode lets you directly edit the patch line by line, so it depends how you count popping open an editorby nagaiaida
7/29/2026 at 11:33:47 PM
VSCode also allows staging/unstaging specific hunks by hovering over the hunk near the left/right separator in diff view - super handy when I need it!by paustint
7/29/2026 at 11:04:48 PM
Neogit, Magit inspired, does the same for Neovim. Would recommend!by rbjorklin
7/29/2026 at 11:12:21 PM
I think you can do the same with tig and lazyvim. Sometimes you just need interactivity.by skydhash
7/30/2026 at 12:25:29 AM
Git gui does per-line staging, and comes with git…by dahart