Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why would I use magit over the git CLI?

1. Discoverability. It'll display the contextually relevant options and commands at most points. By using magit, you're learning the git CLI commands at the same time, including commands that you'd normally never come across without a comprehensive read of the manual or release notes.

2. Fewer keypresses. Also, extra shortcuts for some common operations.

3. The bits that CLIs aren't very good for: staging and unstaging pieces of files, viewing conflicts.

(I do still use the Git CLI a lot of the time too.)



I think (2) is why I use it, it's just much faster. It doesn't let you skip over understanding Git, it just makes you work faster.

I also think that the experiences of:

* looking into a stash and applying only selected changes from it, * browsing all your changes and staging only some of them, * quickly killing changes that you simply want to drop, e.g. not commit and remove from your edits

are much slower when using the command line.


I tend to avoid using stash in that fine grained way because branches are cheap in git, and you get a rich set of operations using a local branch to stack up unorganized code changes. Rely on stash on only very quick setting aside of work then returning to it. If I stash and find it needs to live longer than that - I’ll stuff it into a named branch.


Re: 3 ... I find that the CLI ("git add -p") works here when the scale of the changes I've already carried out is fairly small and there are not too many orthogonal changes in the file tree that I want/need to commit separately. If that happens, it's off to magit I go.


I'm usually a pro-GUI person but I've always found git GUIs to be confusing/trying to paper over the model in a way that made me not like them. Though I don't mind what IntelliJ has. Maybe I need to give this magit tool a try as well.


Sounds like the same for which I started using (and then eventually abandoned) fugitive.

Staging part of files is the only thing I found hard with cli but then fugitive or simply git difftool helps with that too (using vimdiff)

For everything else I defined my own git aliases (git graph, git mr, etc)


1 is really true. Magit is how I learned about workstrees!




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: