Rebase (EN)
ConceptStrategy for integrating branches that rewrites commits and creates a linear history
Definition
Rebase is a strategy for integrating branches where the commits of one branch are rewritten onto the latest state of the target branch. Unlike Merge, which preserves the complete history with merge commits, Rebase creates a linear history without additional merge commits. This approach can make the commit history cleaner and avoids unnecessary merge commits in the history. Rebase is particularly useful for cleaning up local changes before sharing with other team members to ensure a clean history.
Visualization
flowchart LR A[Initial Commit] --> B[Feature Branch] A --> C[Main Branch] B --> D[Rebase Operation] D --> E[Linear History] C -->E
In Context
- Typically used together with Git branching strategies
- Related to: Merge, Cherry-pick, Interactive Rebase
- Example use case: Cleaning up feature branches before merging into the main branch