I'm working on a project where "squash and merge" is the preferred approach for merging pull requests. Is there a way to make this the default option in GitHub, either for my own user, or for the project?
As it stands, it's entirely too easy to select the default option (Create a merge commit). This is made especially problematic by the fact that it is not easily undo-able, given that you generally should not be modifying repository history.
Note that this is different than How to make --squash default on a merge?, as that one refers to the command line usage of Git, whereas my question concerns functionality within the GitHub user interface.
Navigate to 'Settings' in your repository and scroll down to the Pull Requests section. Select Allow squash merging and then select Default to PR title for squash merge commits.
Recursive is the default merge strategy when pulling or merging one branch. Additionally this can detect and handle merges involving renames, but currently cannot make use of detected copies. This is the default merge strategy when pulling or merging one branch.
Adding a pull request to a merge queueOn GitHub.com, navigate to the main page of the repository. Under your repository name, click Pull requests. In the "Pull Requests" list, click the pull request you would like to add to a merge queue. Click Merge when ready to add the pull request to the merge queue.
The GitHub user interface will default the option to the last option selected by the user for the current project. This solves the issue of not accidentally using the wrong default, since after the merge is done correctly for the first PR, subsequent merges will have the desired default.
This solution isn't perfect. If a user makes an intentional one-off merge of a different type, they will need to remember to set it back for their next merge, as the default will have changed to what was intended to be a one-off deviation from the norm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With