Hacker News

152

Rebasing in Magit

by ibobev1773149919106 comments
I use magit daily for over 8 years now. Over that time I have showed it to many other peers, out of excitement for a tool that made me more productive and helped me learn - but I never could convince even one to use it. Maybe it's my persuasion skills, maybe tool usage is too personal - I don't know, but it makes me kind of sad. The UX of magit is just out of this world.

Especially for rebasing, subset rebases (using --onto, see https://git-scm.com/book/en/v2/Git-Branching-Rebasing#_more_...) are a breeze with Magit. I can't remember the order of branches to use on the CLI, in Magit it's just "r s" basically. It's really magic.

by mschulze1773151178
Tangential, but I really wish there would be a performance renaissance with Emacs.

Native-comp was a good step forward, but Emacs is still so much slower than Neovim, even in the case of launching and immediately quitting, with no config:

    $ time emacs -Q -e kill-emacs
    /Applications/Emacs.app/Contents/MacOS/Emacs -nw -Q -e kill-emacs  0.18s user 0.03s system 98% cpu 0.213 total
    
    $ time nvim -es --cmd 'vim.cmd("q")'
    nvim -es --cmd 'vim.cmd("q")'  0.02s user 0.01s system 82% cpu 0.034 total
Even with a very minimal set of packages, text insertion, etc. is slower, and opening Magit (when it hasn't been loaded yet) takes about a second due to slow package loading.

Emacs is my favorite editor, full stop.

But every time I open Neovim or Sublime for quick tasks, it's always painfully apparent how much faster they are when I CMD+Tab back to Emacs.

by jonpalmisc1773152200
I've been using magit for years, and it's the reason I avoided giving the jujutsu VCS a try: the `jj` workflow/UI is supposedly much nicer than the `git` workflow/UI; but since I use magit more than bare `git` commands, that wasn't enough to sell me.

I finally gave it a try when I came across the majutsu package, which is a magit-like interface for jujutsu. I recommend it for Emacs/magit users wanting to try `jj`!

by chriswarbo1773155610
One of my favorite magit tricks: cF (commit with instant fixup).

This lets you add a single-line change to a commit way back somewhere in the log.

by jwr1773157629
Magit is one of the few things that makes me, as a Vim user, envy Emacs. And org-mode, since I'm being honest.
by tambourine_man1773151477
Magit is absolutely the only reason I'm able to use git. And even at that it's still confusing. Yes I know tens of thousands of devs use it every day. I've got some kind of mental block with git. I used to use Mercurial and Subversion without any issues.
by SoftTalker1773158761
I want to quit Magit because it's unbearably slow. In a repo with 6000 files `git status` takes 100ms but the Magit equivalent takes 2-4 seconds.
by shpx1773154802
Magit is absolutely wonderful. It is one of the main tools I use daily to get my work done, especially now that AI does a lot of the work for me. I spend a lot of my time in magit looking at diffs!

I would encourage anyone who relies on magit to sponsor tarsius to make his fantastic work sustainable.

by jwr1773157138
I was missing magit, but then found `gitu` CLI and now use it happily for rebasing.
by nopurpose1773151479
A couple years back I was tinkering with a spacemacs setup and I loved Magit!

Over the years I opted to substitute most tools with simpler, UI-based ones (like LogSeq for org-mode) but I never found a good substitution for Magit.

Having a whole spacemacs setup just for one tool is a bit overkill though, so I just use basic git and accept having to deal with interactive rebases manually.

by codingcareer1773152529
I bounced for a while between Magit and Tig, then ended up just using whatever the IDE provided combined with the CLI. I'm a frequent-but-not-daily Emacs user, so it boils down to the friction of switching tools. I should give up the Jetbrains IDEs and go all in on Emacs.
by antonyh1773152543
by 1773152320
Ilove everything about this post.

"It's super easy! Just do l-Akqr␍=u2025-06-01␍-s--tests␍b!"

by skrebbel1773154240
Magit does give you a surgeon control over the scapel that git is. Most git GUI wants to give you a nice dashboard. The latter is OK if you just want some logs stored (aka git commit and git push), but version control can be a powerful tool especially considering how non linear programming can be.

A patch is an idea, not some snapshot of time. git allows for ideas manipulation. The rebase operation is adjusting ideas to fit a context. And with the reflog (which tracks every operations), you have undo for ideas manipulation.

by skydhash1773151308
Rebasing in magit is so choice. I especially love magit-rebase-subset.
by sandinmyjoints1773151553
magit is still my best firend in emacs :)
by gnuduncan1773152250