Email or username:

Password:

Forgot your password?
28 comments
0xKalypso (they/them) :verified: :unverified:

@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.

0xKalypso (they/them) :verified: :unverified:

@b0rk thank you so much! this is very helpful ๐Ÿ™๐Ÿผโ€‹

๐Ÿ‡บ๐Ÿ‡ฆ haxadecimal

@b0rk @riamaria
"git pull --rebase" is extremely useful and is IMHO an exception to "you never need to rebase". It rebases your own local commits onto a later upstream commit than you started from.

Andreas Sander

@b0rk This is brilliant, Julia! Can you make a poster out of it? ๐Ÿ˜…

Andreas Sander

@b0rk Yeah ๐Ÿ‘, I think that would be helpful already to avoid creating a new printable document based on the image.

Really nice work anyhow!

Mark Levison

@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.

DELETED

@b0rk the squash before rebase tip is something I wish I had known earlier. thanks for making this.

Jeremy Nickurak

@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!)

Julia Evans

@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

Remi Mercier ๐Ÿ”

@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*)?

Julia Evans

@remi I don't understand -- do you mean like the "backwards" part of this image? why would you want to do that?

Remi Mercier ๐Ÿ”

@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".

Julia Evans

@remi thereโ€™s no issue with that, it doesn't change anyone else's commits

Chris Adams

@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:

git-scm.com/book/en/v2/Git-Too

Julia Evans

@acdha do you find rerere works well in practice? are there any downsides?

Julia Evans

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?

Rep. Eric Gallager (no "h"!)

@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...

Dave Copeland :ruby:

@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?

Greg Donald

@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.

Tyler Mumford

@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.โ€

Andrew Jeffery

@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

Toost

@b0rk if it's made a mistake, I've never noticed. I always have a creeping feeling that it will mess something up someday.

Aleksander

@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!

Romain :verified:

@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

Go Up