my rules for git rebase
permalink: https://wizardzines.com/comics/rules-for-rebasing/
28 comments
@riamaria done! i edited the post, here's the link https://wizardzines.com/comics/rules-for-rebasing/ @b0rk thank you so much! this is very helpful ๐๐ผโ @b0rk Yeah ๐, I think that would be helpful already to avoid creating a new printable document based on the image. Really nice work anyhow! @b0rk wow youโre much kindlier than I on this one. I suggest donโt rebase. The results resemble freebasing cocaine, almost always a disaster. @b0rk Have you played with git-rerere? May help in cases like #1. (I'm a huge fan of rebasing, and having lots of tiny commits, AND a huge fan of the work and content you're creating to help people learn this stuff!) @atrus do you find rerere works well in practice? are there any downsides? i'm considering including it but i'm always wary of giving advice that I haven't personally tried @b0rk When you "don't rebase other people commits" do you even avoid rebasing main on your working branch (which I do *all the freaking time*)? @remi I don't understand -- do you mean like the "backwards" part of this image? why would you want to do that? @b0rk Nope, I meant the normal rebase. I think I understood the "I don't rebase others' commits" as "I don't rebase my branch on main (where the commits of others end up". @b0rk Your first point is really good. One thing I've found helps if you need to do that on on multiple branches (very much a โendeavor not to do thisโ situation) is enabling the rerere extension which will remember how you resolved a particular conflict before: a bunch of folks have mentioned that they use rerere to avoid solving the same merge conflict a million times during a rebase. If you use it, do you find it works well? are there any downsides to using it? @b0rk I just turned on rerere in my fork of gcc, and it... kinda helps? It doesn't catch all of the merge conflict resolutions that I might hope it would catch, but it at least catches some of them... @b0rk I used it once and it was so magical and quiet that I thought something went wrong. Soโฆit worked, but maybe should've been a bit more vocal about what it did? @b0rk A coworker told me about it last year? I think. I tried it but it didn't work. We couldn't figure out why. @b0rk Iโve only used it once, but it worked well. I had to fix a big merge conflict with lots of files, and it gave me comfort to know, โIโll only have to fix this once.โ @b0rk Sometimes I have trouble getting it to forget a resolution, which is annoying when it occurs. But I tend to get the resolution right more than wrong, so rerere is a net positive for me @b0rk If rebase is going badly I sometimes do `git reset main` instead and craft the commits I need. A lot of the times itโs a single commit anyway! @b0rk I literally told my 2 juniors today to stop force-pushing rebased versions of their PRs to GitHub if there are already comments on some of the old commits, and to instead merge over them... turns out a lot of nice GitHub stuff breaks when you rewrite history |
@b0rk would you be able to put up a version with your handle/site/signature/watermark on it? I would love to share this with people I teach git to.