-
Notifications
You must be signed in to change notification settings - Fork 2
blog: Merged PR 42: fix(Azure DevOps): Merge PR without prefix in commit message #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
martinkoenig-bbv
merged 10 commits into
bbvch:main
from
ShpendKe:blog/ado-pr-commit-after-merge
Mar 27, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3b4765c
blog: Merged PR 42: fix(Azure DevOps): Merge PR without prefix in com…
ShpendKe f5686ff
remove not needed image
ShpendKe 657a49a
update based on feedback from jerry
ShpendKe 47febe6
small improvements
ShpendKe f881c6c
use table for cc example
ShpendKe 29ca049
styling
ShpendKe 66e5b17
clarifications
ShpendKe 7066c5c
change publish date to monday 23 March
ShpendKe 5033aca
set publish date to 26. march
ShpendKe 62f339e
update publish date to 27 march
ShpendKe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+87.5 KB
blog/2026-03-27-ado-pr-commit-after-merge/images/conventionalcommits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.7 KB
blog/2026-03-27-ado-pr-commit-after-merge/images/disablePrefixInADO.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| --- | ||
ShpendKe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| title: "Merged PR 42: fix(Azure DevOps): Merge PR without prefix in commit message" | ||
ShpendKe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| description: "Azure DevOps has recently added a new feature that allows you to remove the PR ID from the commit message after merging a pull request." | ||
| authors: [shpendkelmendi] | ||
| tags: [Azure DevOps, Conventional Commits, SemVer, Git, Pull Requests, DevOps] | ||
| image: ./images/conventionalcommits.png | ||
| --- | ||
|
|
||
| import CenteredImage from '@site/src/components/Image'; | ||
|
|
||
| <head> | ||
| <link rel="canonical" href="https://shpend-kelmendi.ch/2026/03/06/ado-pr-commit-after-merge" /> | ||
ShpendKe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </head> | ||
|
|
||
| I use Azure DevOps across many customer projects. I really like it. | ||
| One thing I didn't like is the message added to the beginning of the commit when you closed and merged your PR. | ||
| You can see it above in the image or in my title. Not so nice to read, right? I agree. | ||
|
|
||
| ## Why is this important? | ||
|
|
||
| I like to have a clean commit history. | ||
| I like simple git graphs. | ||
| And I want to automate chores like deciding whether a new version is a patch, minor, or major increment. | ||
| That's why I like to use conventional commits which, enable semantic versioning (SemVer). | ||
ShpendKe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Conventional commit is a simple and lightweight convention for your commit messages. | ||
| Here are some examples of conventional commit types and their impact on versioning: | ||
|
|
||
| | Type | Example | Meaning | Version Impact | | ||
| |---------------|------------------------------------------------------------------------|-----------------------------------|---------------------------------------------| | ||
| | **feat** | `feat: login as guest with one-time passcode` | New feature | **Minor** → `1.0.0 → 1.1.0` | | ||
| | **fix** | `fix: correct device registration validation logic` | Bug fix | **Patch** → `1.0.0 → 1.0.1` | | ||
| | **chore** | `chore: update minor version` | Maintenance / small changes | **Patch** or **ignored** (config dependent) | | ||
| | **perf** | `perf: import up to 10 projects` | Performance improvement | **Patch** or **ignored** (config dependent) | | ||
| | **refactor!** | `refactor!: remove deprecated import endpoint` | Breaking change indicated with `!`| **Major** → `1.0.0 → 2.0.0` | | ||
|
|
||
|
|
||
| > If you need support writing conventional commits, try out [commitizen](https://commitizen-tools.github.io/commitizen/). | ||
|
|
||
| The "Merged PR NUMBER" prefix added by Azure DevOps after merging a PR is not helpful. | ||
| So how can we fix this? Let's check our options. | ||
|
|
||
| ## Options for conventional commits | ||
|
|
||
| I know three options when you want to use conventional commits with Azure DevOps. | ||
|
|
||
| ### Manually | ||
|
|
||
| You can change the commit message by: | ||
|
|
||
| 1. Click on the **complete** button in your PR. | ||
| 2. Click "**Customize merge commit message**". | ||
| 3. Replace the commit message. | ||
|
|
||
| <CenteredImage | ||
| src={require("./images/manual.png").default} | ||
| width={500} | ||
| caption="Manually change the commit message when merging a PR in Azure DevOps" | ||
| /> | ||
|
|
||
| But this is not a reliable way in a team. That's why this solution didn't work for our team, and we would not recommend it. | ||
|
|
||
| ### Workaround: Custom Script | ||
|
|
||
| That's why we searched for alternatives. If you just want the commit history to be created correctly, | ||
| John Reilly describes an alternative approach in his [blog post](https://johnnyreilly.com/azure-devops-pull-requests-conventional-commits), using the Azure DevOps API, Node.js, and TypeScript. | ||
| He wrote a tool that uses the autocomplete feature to override the commit message before merging the PR. | ||
| So basically, what you have seen in the previous chapter by doing it manually. | ||
|
|
||
| ### Disable prefix in Azure DevOps Settings (New) | ||
|
|
||
| This problem was seen and reported in [October 2018](https://developercommunity.visualstudio.com/t/Change-default-title-for-pull-request-co/365716#T-ND11055201): | ||
|
|
||
| <CenteredImage | ||
| src={require("./images/featureRequest.png").default} | ||
| width={500} | ||
| caption="Feature request to disable or change the default commit message when merging a PR in Azure DevOps, created in 2018" | ||
| /> | ||
|
|
||
| After endless complaints and a long waiting time, this [feature](https://learn.microsoft.com/en-us/azure/devops/release-notes/2026/sprint-270-update#new-repository-setting-for-pull-request-id-in-commit-messages) has been implemented and released (5. March). | ||
| You can disable the prefix message by: | ||
|
|
||
| * Go to Project Settings | ||
| * Select Repos → Repositories | ||
| * Select a Repository | ||
| * Disable "Include PR ID in the completion commit message title by default." | ||
|
|
||
| If you don't see this, you need to wait a few more weeks until this feature is available for you, too. | ||
|
|
||
| <CenteredImage | ||
| src={require("./images/disablePrefixInADO.png").default} | ||
| caption="Disable the prefix in Azure DevOps settings to have clean commit messages after merging a PR" | ||
| imageSource='https://learn.microsoft.com/en-us/azure/devops/release-notes/2026/sprint-270-update#new-repository-setting-for-pull-request-id-in-commit-messages' | ||
| /> | ||
|
|
||
| ## Conclusion | ||
|
|
||
| Based on the feedback it's not only me, struggling with this design decision. So thanks to the team who took the time to realise this. | ||
| The feature is limited by disabling it per project or repository. You can not set this globally for all repositories in an organization. | ||
|
|
||
| ## Further Reading | ||
|
|
||
| * [Conventional Commits](https://www.conventionalcommits.org) | ||
| * [Change default title for pull request commits to not include PR id - Developer Community](https://developercommunity.visualstudio.com/t/Change-default-title-for-pull-request-co/365716#T-ND11055201) | ||
| * [New Feature to disable PR ID in commit messages - Microsoft Learn](https://learn.microsoft.com/en-us/azure/devops/release-notes/2026/sprint-270-update#new-repository-setting-for-pull-request-id-in-commit-messages) | ||
| * [Blog post by John Reilly: Azure DevOps Pull Requests and Conventional Commits](https://johnnyreilly.com/azure-devops-pull-requests-conventional-commits) | ||
| * [Commitizen](https://commitizen-tools.github.io/commitizen/) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.