Skip to Content
Navigation:

A stick figure smiling

If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript".

browse more comics! get the zine!
read the transcript!

don’t rebase a million tiny commits

you can end up having to fix the same merge conflict 25 times and it’s a nightmare.

instead, do it in 2 steps:

  1. squash into 1 commit with git rebase -i
  2. git rebase main

don’t force push to a shared branch

it’s totally ok if it’s your own branch that nobody else will ever have to git pull from, but if other people are using it, it makes things weird

don’t do more than one thing in a git rebase -i

you can

  • combine commits
  • reorder commits
  • edit commits

but don’t do all of them at once! It’s too confusing!

don’t rebase other people’s commits

I only modify my own commits

stop a rebase if it’s going badly

it’s MUCH easier to run git rebase --abort and bail out than to have to undo it later. It’ll take you back to where you were before the rebase.

you never have to rebase

the only reason to rebase is to tidy up your git history, if you’re not comfortable rebasing then just don’t do it!

You can merge or git commit --amend instead

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)