AZ-400: Designing and Implementing Microsoft DevOps Solutions
Branching Strategies for Source Code
Azure Repos collaborating with pull requests
Streamline your team’s code collaboration with Azure Repos pull requests. In this guide, you’ll learn how to:
- Create a feature branch
- Push changes
- Open a pull request
- Review code
- Complete the merge
Whether you’re preparing for AZ-400 certification labs or improving your CI/CD workflow, this end-to-end pull request process will keep your repository clean and your team in sync.
1. Create a Feature Branch and Push Changes
Start by branching off master so your changes remain isolated.
cd ~/mnt/c/Users/jeremy/Projects/KodeKloudGifts
git checkout -b ChangeFrontPage # Create a feature branch
Open Pages/Home.razor
in your editor and update the marketing copy:
@page "/"
<PageTitle>Home</PageTitle>
<h1>Kode Kloud Gift Shop</h1>
<p>
Welcome to the Kode Kloud Gift Shop,
where you can find the quirkiest and most unique gifts
at unbeatable prices! Whether you’re looking for a gift
for a friend, family member, or yourself, we’ve got you covered.
</p>
Stage, commit, and push your branch to Azure Repos:
git add Pages/Home.razor
git commit -m "Update front page marketing text"
git push -u origin ChangeFrontPage
Note
If you don’t see the new branch right away, have your collaborator refresh the Branches view.
2. Open a Pull Request
Now that your feature branch is pushed, initiate a pull request (PR) to merge into master:
- Navigate to Repos > Pull requests > New pull request.
- Set Source to
ChangeFrontPage
and Target tomaster
. - Add a descriptive title, e.g., Change front page text, and a clear description.
- Assign Jeremy Morgan (or the appropriate reviewer).
- Click Create to open the PR.
3. Review and Complete the Pull Request
3.1 Review Code Changes
As a reviewer, check for:
- Correct source → target
- No merge conflicts
- Clean diffs and concise commit messages
Leave comments or questions inline:
Jeremy: Has this text been approved by legal?
Lloyd: Yes, it’s already been cleared.
(Mark as resolved)
Inspect the diff for Home.razor
:
3.2 Choose a Review Outcome
Azure DevOps supports multiple review decisions:
- Approve (with or without suggestions)
- Wait for author
- Reject
- Abandon
3.3 Merge Settings and Strategies
Once approved, click Complete and pick a merge strategy:
Strategy | Description |
---|---|
Merge (no fast-forward) | Preserve all commits in a merge commit |
Squash commit | Combine changes into a single commit |
Rebase and fast-forward | Apply commits directly on master |
Semi-linear merge | Rebase then merge, preserving a linear history |
You can also:
- Edit the merge commit message
- Complete linked work items
- Delete the source branch automatically
Warning
Deleting the feature branch is irreversible. Ensure you won’t need any additional changes before confirming.
Result and Next Steps
After merging:
- master now includes your updated
Home.razor
. - Any branch policies (build, test, deploy) on master trigger automatically.
- Your team can continue developing new features without conflicts.
This pull request workflow is central to scalable DevOps practices in Azure Repos and is a key skill for the AZ-400 exam.
Links and References
Watch Video
Watch video content