Work in source control
note
The source article for this page was itself marked "work in progress" — including the repeated "Create a pull request" heading below, which is preserved here as-is rather than cleaned up.
How merges work
These diagrams show how merging local files into an Azure DevOps repository works.
The first diagram shows how two users can merge changes to the same repository without merge conflicts. The second shows how merge conflicts occur and are resolved.
No conflict
main
branch A edits page-1.md
branch B edits page-2.md
Both merge into main automatically.
Conflict
main
branch A edits page-1.md, line 12
branch B edits page-1.md, line 12
Second merge needs manual resolution.
Two people editing different docs merge cleanly. Editing the same lines surfaces a conflict to resolve before the pull request can complete.
Checking local updates into Azure DevOps
- After finalizing and saving your content changes in Visual Studio (VS) Code, click the version control icon.
- Click the plus icon above your list of changes. This will stage all your changes and prepare them to be committed to your local repository branch.
- Click in the commit message field.
- Type a brief, clear message describing your changes (something that will help you remember what you did when you're reviewing the revision history).
- Click the check icon to commit your changes to your local repository branch.
- Look to see which branch you're working in (lower left corner of the screen). If it's the main branch, you'll want to create a new branch to publish your changes on Azure DevOps. Click on the branch name.
- Click in the input field in the top middle of the screen and type your branch name (e.g.,
user/your.name/short-branch-description). - Click + Create new branch.
- Click Publish Branch to publish your new branch with your content changes to Azure DevOps.
Create a pull request
- Navigate to the site repository in Azure DevOps. You should see a message mid-screen showing the branch you just published.
- Click Create a pull request.
- Name the pull request and enter a description if changes were complex (for brief, simple changes, descriptions aren't needed). Make sure you are merging into the right branch (this will usually be "main" or "master").
- Click Create. Azure DevOps performs a test merge to see if your changes conflict with changes in the destination branch.
- If you have merge conflicts, click Conflicts and review the changes that are conflicting.
- Review the changes that are conflicting. To resolve them, click the dropdown next to Submit Merge.
- Choose which changes to keep.
- Click OK.
- After resolving any conflicts, click Overview to go back to the main screen.
- If your changes are complex, add reviewers and wait for them to approve before completing your pull request. If your changes are simple, you can approve them. If appropriate for your situation, click Approve.
- After you have necessary approvals, click Complete.
- In the slide-out pane, click Complete merge. This merges your changes into the destination branch you selected and kicks off the build pipeline.
Create a pull request
- Navigate to the project repository in Azure DevOps.
- Click Create a pull request.
- At the top, verify that the branch you are pulling updates from is listed, and either
mainormasteris listed as the branch you're pulling the content into.