4 ms·
As far as I have seen (I prefer the cmdline myself) Git UIs usually have all sorts of features to select what changes should go into what commits down to single
by flohofwoe 5y ago
As far as I have seen (I prefer the cmdline myself) Git UIs usually have all sorts of features to select what changes should go into what commits down to single text lines. IMHO this sort of fine grained 'commit management' would be the only reason to use a git UI over what the command line offers.
- Groxx 5y ago`git add -p` does that as well, it's effectively what the GUIs are using. You can also [e]dit each thing and rewrite as desired, though it can be a bit fiddly. UIs can be nicer though for rewriting / making finer-grained splits than the hunks that -p decides on, definitely agreed there. I have broken out a UI just to simplify staging some gnarly commits. GUIs are also often nicer for understanding and resolving nasty three-way merge conflicts.
- Jaxan 5y agoI very much agree to this. I almost always use “git add -p”.
- Groxx 5y agotbh I think the staging area (and popularizing local branches) may be git's greatest contribution. being able to selectively build a commit is a game-changer for creating understandable histories, and stopping local-tweak "leakage". distributed VCS is neat and all, but the vast, vast majority of cases have a canonical source-of-truth repo somewhere, and the rest are effectively just private mirrors. for those cases, distributed is mostly a significant source of complexity rather than capability. though it is significant to have an "escape hatch" when you need it.
- agateau 5y agogit gui, which comes with git, is quite efficient to do partial commits. I wrote an article about this a few years ago: https://agateau.com/2016/an-intro-to-git-gui/ https://agateau.com/2016/an-intro-to-git-gui/
- deleted 5y ago[deleted]
- Groxx 5y agoI haven't actually tried git-gui, only gitk... I'll have to give it a try, thanks :) A first-party GUI actually gives me some hope for correct behavior. gitk is broadly excellent for example and performs great, though other GUIs do some things more smoothly - exactly what I'd want in a first-party GUI.
- hoseja 5y ago>To stage part of a file you need to use a command line program to step through each hunk and if a hunk can't be split down any further but contains code you don't want to stage, you have to edit an arcane patch file by hand? Are you KIDDING me?! I repeatedly run into this using the interactive features.
- ossopite 5y agoyes, and in my experience UIs make this much easier than -p but for me a bigger reason to prefer a git UI is that I can actually see the graph. I can do things like drag branches between commit nodes. I find this so much easier and safer than the cli