Creating a Squash Merge
Squash merge is to merge all change commit information of a merge request into one to simplify the commit information. When you focus only on the current commit progress rather than the commit information, you can use squash.
If Squash is selected, multiple consecutive change records of the source branch can be merged into one commit record (information of Configure Squash), and this new commit record can be committed to the target branch.
- If the change history of the merge request contains only one commit, the commit record in the target branch is for the source branch after Squash is selected.
- If the change history of the merge request contains multiple commits, the commit record in the target branch contains the information of Configure Squash after Squash is selected.
To better understand this function, perform the following operations:
- Create a repo and a branch.
The repo name is repo, and the branch name is Dev.
- Dev branch: Create two files and name them Function_1 and Function_2.
- Check the effect before Squash is enabled. Click the Dev branch and choose Code > Commits > Commits to view the commit information.
- Create and merge a request.
- Set the source branch to Dev and target branch to master. Create a merge request.
Dev branch: Name the merge request as Squash, select Squash, and enter Configure Squash.
- After the merge request is reviewed and approved, the request can be merged.
- Set the source branch to Dev and target branch to master. Create a merge request.
- Check the effect after Squash is enabled. After the request is successfully merged as shown in the following figure, click the Code, Commits, and Commits tabs, select the master branch. Compared with Step 4, the committed content has been merged.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot