13 ms·
Magit is such an unbelievably good piece of software. If you haven't used it, please at least take a look. It seems like "just a GUI for git", but that's missin
by jwr 5y ago
Magit is such an unbelievably good piece of software. If you haven't used it, please at least take a look. It seems like "just a GUI for git", but that's missing the point — many operations suddenly become frictionless, so your entire workflow changes.
I regularly do things like "stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes", and they become routine, so working with code becomes a fluent experience, rather than fighting with your tools.
I would say that Magit and structural editing using Paredit are the two most important technologies that make programming great.
- agumonkey 5y agoThe first two extension I set in Emacs. Reminds me it's time to tip some projects.
- wodenokoto 5y agoCan I like magit if I don’t like emacs?
- mgr8 5y agoyou can try https://github.com/jesseduffield/lazygit https://github.com/jesseduffield/lazygit, i think its quite similar. It is a TUI for git. It has made my git workflow very friction-less. Makes it very easy to cherry-pick commits, rebases, selecting chunks of files to add in atomic commits, and simplifies the resolutions of merge conflicts. It is also integrated into lunar vim if vim is more up your alley
- sokoloff 5y agoYou can, but it will be worth it for you to spend a little effort to learn the basic buffer, window, and cursor management keystrokes. My 12 year old uses magit as a git interface and nothing else in emacs. That’s not a great testimonial as it was my direction to do that, but it seems to work just fine. The areas where magit earns outsized praise is not around a basic “pull, add and commit everything, push” workflow, but rather around being selective about crafting self-consistent but single-theme revisions. That will not be as fluid for someone with no fluency in emacs keyboard navigation, but I think I’d still find it easier than using the git command line to do it. (Hard for me to say with 30 years of emacs in the rear view.)
- jolmg 5y ago> but rather around being selective about crafting self-consistent but single-theme revisions Actually, I think git's got Magit beat on that. Magit might make it easier to stage specific lines, but git can stage specific parts of lines or even changes that are completely different than what's on the worktree, through the editing of diffs with `git add -p`'s `e` option.
- dan-robertson 5y agoWhat percentage of git users do this compared to the percentage of magit users staging line-by-line or confidently amending/cherry-picking/interactive-rebasing?
- deleted 5y ago[deleted]
- TeMPOraL 5y agoI'm somewhat convinced you can replicate that last feature (staging arbitrary / sub-line pieces of your changes) through ediff-staging (E s), but ediff is a complex tool in itself, and I don't know how to use it properly yet. (Ediff is a 2-way / 3-way interactive diffing interface, built into Emacs, with plenty of features for surgical diffing of files, buffers, directories and whatnot.)
- deleted 5y ago[deleted]
- NateEag 5y agoMagit has great support for staging parts of lines - select the section you want to stage and press 's'.
- amake 5y ago> Magit has great support for staging parts of lines This is news to me. > select the section you want to stage and press 's'. It stages line-wise for me. How do I get it to stage less than an entire line?
- b0afc375b5 5y agoAbsolutely. I can honestly say I learned Magit first (since it was directly applicable to my job) before I "properly" learned emacs.
- stinos 5y agoIn my experience: yes but it I have the impression it'll remain a bit of a struggle unless you go all in and learn emacs as well. After hearing so much good of Magit in a previous thread here I thought 'ok why not?' and installed emacs and magit. That alone wasn't a walk in the park as I never used emacs before. Maybe I did something wrong but what I remember from it is mainly 'wtf x 10 and what kind of documentation is this'. After some hours I got the hang of it, and I see why it is liked, but still it didn't make me any faster with git because I already have everything needed for my main workflows (SublimeMerge + aliases). Also felt like to get any real value from it I'd need many extra hours on the learning curve and it wasn't clear to me whether the end result would actually be better than what I do now. So I skipped on it, but again: I fully understand that if you use emacs anyway it would be crazy not to use magit.
- caskstrength 5y agoDepends on what you mean by not liking emacs. If you prefer vim, then you can just install Evil to get similar-ish modal keyboard controls. If you are more of an IDE-person who likes controlling stuff with a mouse in VS or IntelliJ, then probably no.
- agumonkey 5y agoI believe magit underlying ideas are good no matter what software you use, it's not an emacs only principle. It's just keyboard oriented, text-light interaction design if you will. invoke versionning (key 1), see what's changed, pick the parts you like (few navigations keys and 2 keys to pick/unpick), invoke commit (key 4) write and accept (key 5) (amend is key 6 if you made a mistake) It's just fast, lean and tailored. Apparently people did it in vi too. I just wish it was the case in more places. Actually, whenever I write a vuejs thing, I try to embed keyboard as much as possible.
- pbiggar 5y agoThere's a VSCode plugin based on magit. In my experience, it's basically identical (though occasionally a bit slow when there's lots of files). https://marketplace.visualstudio.com/items?itemName=kahole.magit https://marketplace.visualstudio.com/items?itemName=kahole.m...
- coyotespike 5y agoI used my own emacs for several years, then switched to Spacemacs. It's far easier to learn and use for most people, and also works with Vim keybindings. I'd recommend giving it a try.
- weaksauce 5y agoif you like vim i'd suggest you install spacemacs and the git layer.
- matheusmoreira 5y ago> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for visualizing branches, commits and diffs. I just don't understand why the git commands seem to cause so much trouble.
- jackcviers3 5y agoYeah, it's definitely the mnemonic single-key and terminal gui that makes magit great. That, and the genuinely low occurrence of bugs in the software.
- kmarc 5y agoI am the same. After the pandemic started and I had to witness over screen share how colleagues "use" (fight) git with all sorts of GUI tools, I had to realize that no GUI can be good enough while one doesn't understand git, or, even worse, it can be contraproductive, because people using these GUIs _think_ they understand, but they don't. I even ended up creating a (tailored) 2x90min git course... All that said, I heard magit praised so many times, I still have some hope that it's really as good as its reputation. (Tried fugitive, which is the vim-world's answer to magit, even learned it properly but realized I always juzt <C-z> to the terminal and do stuff with the cli)
- matheusmoreira 5y agoI gained a better understanding of git through this document: https://eagain.net/articles/git-for-computer-scientists/ https://eagain.net/articles/git-for-computer-scientists/ I'm not a computer scientist and I think it's understandable. Everything became a lot more clear in my mind once I understood the inner workings.
- ThaJay 5y agoThat's a really cool article. The wording could be a lot simpler but the important part is that it does not abstract the concepts. They don't need to be abstracted because they are really simple. Situations can become very complex, especially when someone does not know what they are doing. Developers need to learn the priciples without lies and overzealous simplifications. If you know what's going on it's a lot more doable to not end up in a super complex situation, but not a lot of people have a really good explanation of git even if they understand it very well themselves.
- siraben 5y ago> I would say that Magit and structural editing using Paredit are the two most important technologies that make programming great. I would also add undo-tree to that list, it's like having a lightweight VCS on every file without needing to resort to git.
- aidenn0 5y ago> I would say that Magit and structural editing using Paredit are the two most important technologies that make programming great. That's interesting because those are two tools I've tried to adopt multiple times, but never have managed to do. Paredit is at least partly due to my long use of vi (and almost as long use of vim) keybindings; I use evil-mode, and bind << and >> to the appropriate adjust-parens functions for strucutural editing. Magit is due to me having used git for so long that it takes me at least 5-10x as long to do something with magit as with the git terminal, and I'm just not at a point in my life where I desire to fight with my VCS when there is another option. I suppose I'm just stuck in local maxima with regards to those two things, but I'd say I'm fast enough.