Step 1: Initialize the Default Main Branch
Navigate to Azure DevOps:
Go to Azure DevOps and sign in with your credentials.
Select Your Project:
Choose Project1 from your list of projects.
Initialize the Main Branch:
Goto Repos > Files.
If the main branch does not exist, you will see an option to initialize it. Click on Initialize and follow the prompts to create the main branch1.
Step 2: Enable Squash Merge for the Main Branch
Navigate to Branch Policies:
Go to Repos > Branches.
Find the main branch and click on the … (ellipsis) next to it.
Select Branch policies.
Enable Squash Merge:
Under Policies, scroll down to the Merge strategy section.
Select Squash merge as the required mergestrategy2.
Save Changes:
Click on Save changes to apply the policies.
Step 3: Verify the Squash Merge Policy
Create a Pull Request:
Make achange in a branch and create a pull request to merge it into the main branch.
Complete the Pull Request:
Ensure that the pull request uses thesquash merge strategy by selecting Squash commit under the Merge type in the Complete pull request dialog