I basically only use git merge
like Theo from T3 stack. git rebase
rewrites your commit history, so I feel there’s too much risk to rewriting something you didn’t intend to. With merge
, every commit is a real state the code was in.
I basically only use git merge
like Theo from T3 stack. git rebase
rewrites your commit history, so I feel there’s too much risk to rewriting something you didn’t intend to. With merge
, every commit is a real state the code was in.
It’s not rebase vs merge, it’s rebase AND merge.
Commit your changes into logical commits as you go.
Then just before submitting a pull request, review your own code. That includes reviewing your own commits too, not just the code diff.
Use rebase to:
Then, and only then, after you have reviewed your own code and used rebase to make the git history easier to read (and thus make it easier to review), then you can submit a pull request.
love this approach and it’s what I usually use. I also don’t rebase after opening a PR (GitHub) because force pushing ruins reviewer context in the GH UI. so after the PR is open I merge main/master in instead of rebasing.