azure-devops

How to change PR merge commit message?


When pull requests are created, their commit message is always like "Merged PR### from {branch name} into {target branch name}"

I keep amending commit messages and this is a bit tiring. I rely on the commit messages to keep track, so the automatic messages present a problem.


Solution

  • This is a feature of Azure DevOps, the purpose is making it clearly to describe what happened for each commit.

    For the commit message with a merged commit by pull request, the default commit message is defined by the version control system on the server side (such as Azure DevOps, GitHub etc) wherever your repository hosted.

    And it's a good habit to add the pull request information in commit message since the commit is merged by PR.

    As you found, the default merge commit message in VSTS pull requests is like Merged PR <pull request ID>: branch1 to branch2.

    There are additional version control solutions, such as GitHub, where the default merge message for pull requests is like Merge pull request #<pull request ID> from account/branch.

    If you want to use your own commit message for merging Azure DevOps pull request, just custom the commit message as you need in the text box before clicking Complete merge button (such as change the default message "Merged PR 118: master to b1" in text box in below example).

    enter image description here