You can merge pull requests by retaining all the commits in a feature branch or squashing all commits into a single commit.
When you click the default Merge pull request option on a pull request on your GitHub Enterprise instance, all commits from the feature branch are added to the base branch in a merge commit. The pull request is merged using the --no-ff
option.
To merge pull requests, you must have write permissions in the repository.
Squash and merge your pull request commits
When you select the Squash and merge option on a pull request on your GitHub Enterprise instance, the pull request's commits are squashed into a single commit. Instead of seeing all of a contributor's individual commits from a topic branch, the commits are combined into one commit and merged into the default branch. Pull requests with squashed commits are merged using the fast-forward option.
To squash and merge pull requests, you must have write permissions in the repository, and the repository must allow squash merging.
You can use squash and merge to create a more streamlined Git history in your repository. Work-in-progress commits are helpful when working on a feature branch, but they aren’t necessarily important to retain in the Git history. If you squash these commits into one commit while merging to the default branch, you can retain the original changes with a clear Git history.