- Re-apply a series of commits to a different initial parent commit.
- Alters the commit history since all parent commits and timestamps will be altered.
- Results in a cleaner commit history with fewer merge commits.
- Can still result in conflicts just like merging.
- You are the only person working on the branch.
- You want to eventually be able to do a fast-forward merge of this branch back into another branch.
From man git-rebase
Assume the following history exists and the current branch is "topic":
A---B---C topic
/
D---E---F---G master
From this point, the result of either of the following commands:
git rebase master
git rebase master topic
would be:
A'--B'--C' topic
/
D---E---F---G master