GitHub.com 上でプルリクエストのマージオプションを設定して、ワークフローの要求と Git の履歴管理への要望を満たすことができます。 詳しい情報についてはプルリクエストのマージの設定を参照してください。
squashマージのデフォルトのコミットメッセージに関する情報については「プルリクエストのマージについて」を参照してください。
- GitHub.comで、リポジトリのメインページにアクセスしてください。
- リポジトリ名の下で Settings(設定)をクリックしてください。
- Under "Pull Requests", optionally select Allow merge commits. これにより、コントリビューターがコミットの全ての履歴と共にプルリクエストをマージできるようになります。
- Under "Pull Requests", select Allow squash merging. これにより、コントリビューターが全てのコミットを 1 つのコミットに squash してプルリクエストをマージできるようになります。 The squash message automatically defaults to the title of the pull request if it contains more than one commit. If you want to use the title of the pull request as the default merge message for all squashed commits, regardless of the number of commits in the pull request, select Default to PR title for squash merge commits.
If you select more than one merge method, collaborators can choose which type of merge commit to use when they merge a pull request. If there is a protected branch rule in your repository that requires a linear commit history, you must allow squash merging, rebase merging, or both. 詳しい情報については保護されたブランチについてを参照してください。