Instructions on Merging Pull Requests to an openEuler Repository
Instructions on Merging Pull Requests to an openEuler Repository
PR Merge Methods
1. rebase merge
In this method, all commits are merged to the target branch, and the changelog of the target branch in the target repository does not contain any information about the pull requests (PRs).
Example:
2. squash merge
If this method is used, all commits are merged into a new commit with the PR title as changelog, and then merged to the target branch.
Example:
3. default merge
In the default merge method, all commits and a new commit with the PR title as changelog are merged to the target branch.
Tips: The test cases in the examples have two PRs each, and three merge methods are tested.
Comparison of the three merge methods:
Adding the merge_method Field in a Repository File
Currently, the Gitee platform provides three PR merge methods: merge, rebase merge, and squash merge. merge is the default method and does not require extra configuration.
For the rebase merge method:
name: A-Tune-BPF-Collection
description: A-Tune-BPF-Collection is BPF based tunning tools collection
branches:
- name: master
type: protected
type: public
merge_method: rebase
For the squash merge method:
name: A-Tune-BPF-Collection
description: A-Tune-BPF-Collection is BPF based tunning tools collection
branches:
- name: master
type: protected
type: public
merge_method: squash
For the default merge method:
name: A-Tune-BPF-Collection
description: A-Tune-BPF-Collection is BPF based tunning tools collection
branches:
- name: master
type: protected
type: public
Changing the Merge Method Through PR Comments
For details about command usage, visit https://gitee.com/openeuler/community/blob/master/en/sig-infrastructure/command.md.
(1) Using the /rebase command
Use the /rebase command to add the merge/rebase tag to the PR, indicating that the rebase merge method is to be used. To change the merge method, use /rebase cancel to remove the merge/rebase tag.
(2) Using the /squash command
Use the /squash command to add the merge/squash tag to the PR, indicating that the squash merge method is to be used. To change the merge method, use /squash cancel to remove the merge/squash tag.
(3) Using neither of the two commands
PRs are merged in the default merge method.
Priority of Merge Method Changes
The priority of a PR comment is higher than that of merge_method field configuration in the repository file.