git rebase: what can go wrong?

git rebase: what can go wrong?

Julia Evans
@b0rk Great post! We use Squash + Merge at work too. I started using it at Kickstarter 5 years ago and was very reluctant at first - mostly because I was taking pride in creating pull requests with a very clean Git history... I wouldn't go back though: I can now keep it dirty simple, move faster and choose to rebase or merge depending on the use case. It also makes `main`'s history much cleaner: 1 PR == 1 commit.

@pcreux @b0rk I came here to say the same thing. I commit _a lot_ and don't ever bother thinking about my commit history until I'm getting ready to submit a PR.

If I somehow ended up with a PR that's large enough that it really should be split into multiple commits, I'll create a new branch off main, do a `git merge --squash`, only add the files/lines that should be part of that commit, and discard the rest.

@b0rk Also, you mentioned having a bunch of "wip” and "typo" commits, which I do do *sometimes*, but most of my commit messages are notes to myself. “Got most of the tests working, except for that one DB call”, “Everything runs, but need to format the new file”.

Super useful when I'm working on something a few hours at a time over the course of a week, it helps me remember what I was thinking.