3 ms·
Work with Git Forges from Magit
- tra3 4y agoI've been using git for a while now, through combination of command line, tig [0] and lazygit [1]. Is it worth transitioning to magit? It's touted as one of the hallmarks of emacs, akin to org-mode. What I'm saying is, I'm quite productive with git already, is magit really the next level? [0] https://jonas.github.io/tig/ https://jonas.github.io/tig/ [1] https://github.com/jesseduffield/lazygit https://github.com/jesseduffield/lazygit
- kayman 4y agoIf you're an emacs user and you code in emacs, magit works really well with your workflow.
- fragmede 4y agoHow often do you wish you could easily commit parts of what's changed? Or more specifically, how often do you use git add -i or git add -p to stage (and then commit) partial changes? You can argue you've never done that and therefore don't need it, but that's something Magit makes easy and you end up using it quite frequently, if you bother to learn it.
- tra3 4y agoMy whole workflow is based on `git add -p`.. I'm sold, going to give it a go.
- sreevisakh 4y agoJust to add a point here - lazygit (mentioned in the question), gitui etc all allow easy interactive partial staging that you suggest. It's great that these tools gives interactive staging the importance it deserves. I prefer magit because it is well integrated into the editor itself, while mimicking the command line git as closely as possible. Magit allows me to use git from a GUI/TUI without the fear of forgetting the command line tool. Meanwhile, there is another tool that deserves special mention for interactive staging - (neo)vim's fugitive. It treats the working copy and the index as two buffers and opens them in diff mode. You can compare the two versions directly as plain text, instead of as formatted diffs like in case of magit. Staging as simple as using diffput, diffget, etc.
- robto 4y agoMagit changed git from just a DVCS to a integral part of my dev process. Especially in large projects where I spend much more time reading code and trying to understand how it came to be the way that it is. I mainly write Clojure, but for a while I was writing Scala (many years ago, when its emacs support was inferior to Intellij, I don't know what the state is these days). When I was using Scala it wasn't my emacs-style keybindings that I missed the most (though I did miss them), it was the mind-meld instant navigation of the project history that slowed me down. I ended up suffering the emacs support while planning my changes just so that I could use Magit to read history. Then I'd switch back to Intellij for actual authoring. It's incredibly flexible, but here are some things that I do all the time in Magit that I hesitate to do when I'm just using the cli: - stage individual lines from a hunk - rebase fearlessly - resolve merge conflicts - view the list of all commits that touched a file - view a file from the above list at a point in time next to the current version - name my stashes! All of these are possible from the cli or other git uis, but they are very discoverable using Magit - I didn't even know you could name stashes until I was prompted for a name while stashing. And Magit will happily log all the actual git commands that it runs, so if you're curious how it works you can easily peak behind the curtain.
- seanw444 4y agoI struggled remembering to use the various useful features of Git, especially stashes. I use them all the time now, whereas I just simply forgot they existed back when I used the command line. The UX/UI is also just super intuitive and fast. Rather than tediously typing out a long command (let's be honest, a lot of Git commands can be), it's cut down to a very short string of keys. Personally, Magit is the best Git UI I've ever used. It can do basically everything the official CLI can, so you're not missing out due to an added abstraction, like most Git UIs suffer from.
- emptysongglass 4y agoIf you didn't know and you're a VS Code user, there is an implementation of Magit for VS Code: https://marketplace.visualstudio.com/items?itemName=kahole.magit https://marketplace.visualstudio.com/items?itemName=kahole.m...