When you merge a pull request, you can squash all commits into a single commit. Merge squashing retains all your pull request changes, but omits the individual commits from the Git history.

You can merge pull requests by either retaining all the commits in a feature branch or by squashing all commits into a single commit.

When you merge a pull request and squash commits, you gain a more streamlined Git history that doesn't include individual commits. Individual commits create a detailed log of your feature branch but can be unnecessary when viewing the history of your base branch.

Users with admin permissions can configure pull request merge options on branches in several ways:

  • Allow both merge commits and commit squashing
  • Allow only merge commits
  • Allow only squash commits

Pull request merge squashing

Note: When a pull request is merged and commits are squashed, only the user that merged the pull request and the user that opened the pull request receive contributions. No other contributors to the pull request will receive contribution credit.