Skip to content

Using Git Rebase

Rebasing is the process of integrating a sequence of commits into a new base commit. The idea behind rebasing is similar to when a branch is created. When you create a branch you diverge from a base commit (often main); by rebasing you change your commit change to appear as if you had branched from a different base commit than originally used.

One of the main reasons for rebasing is to maintain a clean commit history. In the end this makes regressions and bug-finding easier.

Never rebase commits once they've been pushed to a public repository unless its your feature branch and nobody else is working on it

One issue with rebasing is that it can cause many merge conflicts in the process of rebasing. This can be remedied by rabsing your branch frequenclt againt main and making more frequent commits.

ADDITIONAL RESOURCES