git/rebase

Rebase Branch

Reapply commits on top of another base tip

git
rebase
branch

Command

git rebase

Explanation

git rebase is used to reapply commits on top of another base tip. It reapplies the commits on top of another base tip.

Examples

Rebase current branch onto main

git rebase main

Interactive rebase last 3 commits

git rebase -i HEAD~3