4 ms·
In my opinion git GUIs have two major adventages: 1. you can see all the information at on glance: current branch, all local branches all remotes and remot br
by laszlokorte 7y ago
In my opinion git GUIs have two major adventages:
1. you can see all the information at on glance:
current branch, all local branches all remotes and remot branches, local changes, recent commits, current merge conflics
2. cherry picking single lines for staging in multiple files is much faster in a GUI than via terminal (maybe there are clever tricks to make it easier I don't know of)
- ProZsolt 7y ago1. Do you really need that? It looks good, but how useful it is? I usually only care about my branch and the branch I like to merge in. 2. Yes, that was the only reason I have used git GUIs, but most modern editors have these features built-in.
- richardwhiuk 7y ago`git add -p` is pretty fast for staging parts of files
- konart 7y agoUnless I'm missing something - it only shows you a hunk, without much (or any) context. It's relatively fast to stage hunk like this, but you are doing it like blindly.
- skrtskrt 7y agoI use git add -p almost exclusively & I'm a big fan, to me the limitation is when the part I want to stage and the part I don't are so close together that they get presented to me as a single atomic chunk to add/not add.
- dbalatero 7y agoDo you ever hit 'e' to edit? You can alter the patch manually in Vim/$EDITOR – this is what I do when I hit those edge cases.
- skrtskrt 7y agoAh no - but I will now! Still, usually what I need there is the ability to leave a line or two there but don't stage it.
- richardwhiuk 6y agoYou can also press 's' to split in some cases.
- u801e 7y agoAn alternative is using TUI application like vim in conjunction with tools like recountdiff and git apply to handle staging and unstaging parts of files. You get more context because you can see other parts of the diff in the editor, unlike when using the -p switch with the git add or reset commands.
- konart 7y agoI'm actually using NeoVIM + fugitive and git-gutter. GitGutter make working with hunks easy
- u801e 7y agoLooking at the README of vim-gitgutter[1] (assuming that's the plugin you're referring to), it says the following: >> You cannot unstage a staged hunk. I'm not sure if that's a feature they plan to support, but something like this could easily be done by highlighting the hunk displayed when running git diff --cached in vim's linewise visual mode and filtering it through git apply -R --cached -. [1] https://github.com/airblade/vim-gitgutter https://github.com/airblade/vim-gitgutter
- blux 7y agoWhat is the use case for 'seeing all information at once'. Normally you want to see something specific, in which case a terminal allows you to see that specific information faster than a GUI.
- laszlokorte 7y agoIf all information is already on the screen I am faster moving my eyes to the spot of interest than typing the command (or even a single letter alias). I guess you would not want to edit a text file of which you could only see a single line at a time.
- konart 7y ago>What is the use case for 'seeing all information at once'. Projects can be messy and sometime you really need a bird's view of what's going on with all those branches\merges etc.
- hombre_fatal 7y agoGUI also makes it easy to cross-reference between branches, automatically pull submodules, see/do all sorts of things without keeping crufty cli args in your head. I mean, the latter is huge. I felt a certain bravado in uni for always using the cli that I see among other HNers. As I get older, I couldn't give less of a damn. Scrolling manpages to find an re-remember the unintuitive cli arg I need vs just clicking a button that does it? I prefer the latter. The former is always available if I need it. The few times I have to drop into cli git are the things I always have to look up anyways, like git-reflog.