Preview Squash Support for the Pull Request Merge API

UPDATE (2016-09-26): As announced, there is an extended version of the preview support of merge methods in the Pull Request Merge API available. This older version will be removed once the new one becomes official.

With the recent addition of squashing Pull Requests via the merge button, we're adding support to squash Pull Requests in the API as well. You can squash a pull request in the Pull Request Merge API during the preview period by providing a custom media type in the Accept header:

application/vnd.github.polaris-preview

For example:

curl "https://api.github.com/repos/github/hubot/pulls/123/merge" \
  -XPUT \
  -H 'Authorization: token TOKEN' \
  -H "Accept: application/vnd.github.polaris-preview" \
  -d '{
    "squash": true,
    "commit_title": "Never tell me the odds"
  }'

During the preview period, we may change aspects of these API methods based on developer feedback. We will announce the changes here on the developer blog, but we will not provide advance notice.

If you have any questions or feedback, please let us know.