4 ms·
Why do you need to use a git "client"? What's wrong with just using the standard CLI? I use VS code and never bother with its git ui. Just open a terminal and u
by perryizgr8 6y ago
Why do you need to use a git "client"? What's wrong with just using the standard CLI? I use VS code and never bother with its git ui. Just open a terminal and use git commands.
- deleted 6y ago[deleted]
- kubanczyk 6y agoGit CLI is fantástico if you want to do two things per hour. If you want to do twenty, it's just too many keystrokes. Even if we only talk basic add/commit/push. Two especially laborious operations are `git add -p` and `git rebase -i`. Try them out on magit, you'll see the difference.
- hawski 6y agogit gui is way to go.
- ttt0 6y agoNothing's wrong with using CLI. You might not need it, but sometimes it's nice to have something with more. Most people on this planet think that managing files from terminal is pure insanity, and I do just that, I didn't even bothered to install a graphical file manager. And yet I use a git client/front-end in my text editor, because it's nicer to do some things that way. The most useful feature is probably interactively staging hunks just like you'd edit a text file over what standard git does.
- submeta 6y agoHow do you selectively stage several hunks from command line in git? - Imagine you edited a large file, fixed two different things, now you‘d like to select the changes related to one thing first and commit them. And then the next changes. In Magit you visit the file you changed, hit `C-x g' and see all diffs. Now you can review and select hunks by hitting „s“ (stage), go to the next relevant hunk and hit „s“ again to mark for staging. And when you‘re done selecting all changes that are relevant for one ticket, you hit „c“ twice to write a commit message. And off to the modifications/ hunks regarding second ticket. So how‘d you do this in command line?
- codethief 6y agoHow about $ git add -p path/to/the/file ? Combine this with your favorite tool for command line auto-completion of paths (and, maybe, a git alias to avoid typing `git add -p` all the time) and it's extremely fast.
- submeta 6y agoI am presented with one hunk at a time, and have to decide if I want to stage or not (with a text "menu" underneath it: "(2/2) Stage this hunk [y,n,q,a,d,k,K,g,/,e,?]?" And then I navigate with j/k (down/up). Yes, it does the job. Matter of preference. But if you worked eagerly on three / four different topics and try next to create several different commits by getting a visual overview of all hunks with the abilitiy to selectively stage is a little more comfortable.
- nickjj 6y agoIf you have multiple files then you can choose to omit the file name and git will let you decide on each hunk for each file. You can also hit "s" to split a hunk to only commit a part of a hunk of if you want fine grained control you can hit "e" to edit just that hunk in your $EDITOR to only select a specific line or whatever you want. Personally I tried fugitive and other git clients in the past and always come back to git add -p on the command line. It just feels the most natural and it also forces you to look at the hunks, so there's really no chance you'll accidentally forget to add something. When using GUIs with sidebars showing what files changed, etc. it's easy to forget to add something because you skim it without really paying attention to what was changed.
- deleted 6y ago[deleted]
- psYchotic 6y agoThis may have been semirecently been added to git, but look into [0]: git add -i It launches a fairly simple interactive text UI that allows you to select files to stage, and it allows one to "patch" into the staging area, which works by showing you a bunch of hunks, asking for each if you want to stage it (or you can even edit a hunk in your $EDITOR). I'm sure it's not nearly as nice as Magit's UI, but I've been a happy user of this feature for a while. [0]: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
- akho 6y agoTry Magit. You’ll know whether it works for you. It clearly does for many people. Or fugitive in Vim. The difference is like that between using Ed and Vi. Seeing things as you do them is valuable.
- jidiculous 6y agoimo the strength of Magit (and its author has certainly said so) is that while the Git CLI provides a slightly different interface that you have to learn for each different operation, Magit provides a consistent UI for every single Git operation it supports (around 90% of Git features).