Rebase

Rebase is a command in Git that allows us to rewrite commit history. Make use of it to keep a clean commit history!

Refer to the rebase documentation here

Some Use Cases

  • cleaning up the history of your feature branch before merging into dev
  • integrating new features from dev branch into your feature branch without creating a merge commit

Things to note

  • DO commit and rebase often on your feature branch to reduce merge conflicts

If uncomfortable with using rebase, you can create a temporary copy of your branch to test out rebase

  • ⚠️ If your feature branch has already been pushed, you will need to force push and overwrite the remote branch
  • DO NOT rebase and force push to a shared branch

Force pushing to a shared branch will potentially overwrite the work of other developers when they pull

Learn More