Squashing
Git squashing combines multiple commits into a single commit when a branch is rebased or merged into another branch. This helps to reduce the number of commits cluttering git log, makes navigating the commit history easier and can reduce the number of merge conflicts.
Use Cases:
Examples:
When merging a branch:
git merge --squash [branch-name]
When the branch is commited after merging all commits from the incoming branch will be squashed into one.
When markng commits in the interactive rebase editor:
squash [commit to squash]
The marked commits will be squashed when rebasing is finalized.