When is it recommended to use Git rebase vs. Git merge?
Do I still need to merge after a successful rebase?
2022-12-21
When is it recommended to use Git rebase vs. Git merge?
Do I still need to merge after a successful rebase?
So when do you use either one?
Squashing: All commits are preserved in both cases (for example: "add feature", then "typo", then "oops typo again"...). Commits can be combined into a single commits by squashing. Squashing can be done as part of a merge or rebase operation (--squash flag), in which case it's often called a squash-merge or a squash-rebase.
Pull Requests: Popular git servers (Bitbucket, GitLab, GitHub, etc...) allow to configure how pull requests are merged on a per-repo basis. the UI may show a "Merge" button by convention but the button can do any operations with any flags (keywords: merge, rebase, squash, fast-forward).