Dev.to
6/17/2026

Why git pull --rebase should probably be your default
Short summary
Git pull --rebase rewrites local history to create linear commits, avoiding cluttered merge commits in PR reviews and git log. Rebase is safe for unpushed branches and feature branches you own, but never for shared branches like main. Configure `git config --global pull.rebase true` to make rebase your default.
- •git pull --rebase replays commits on latest main instead of creating merge commits
- •Safe for local/feature branches only; never rebase shared branches like main or develop
- •Configure with `git config --global pull.rebase true` for cleaner linear team history
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



