22

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.

2
  • 1
    If you don't squash commits, you'll get the complete history of the developer's changes. They can clean up the commit history prior to opening their PR. learn.microsoft.com/en-us/azure/devops/repos/git/… Commented Apr 11, 2019 at 21:54
  • You can also navigate to the PR to see the details long after it's been completed and the originating branch has been deleted. The PR is a hyperlink when looking at commit history from the Azure DevOps repository view
    – bryanbcook
    Commented Apr 11, 2019 at 22:18

1 Answer 1

11

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 git server side (such as Azure DevOps, github etc) where your git repo 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 request like Merged PR <pull request ID>: branch1 to branch2.

Additional, such as GitHub, the default merge for pull request 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

10
  • 67
    Trying to get developers to remember to do this everytime is pretty futile. It would be nice to be able to customise the convention used. Commented Jul 11, 2019 at 10:24
  • 8
    Revisiting this in 2021: Is there a way to set default commit merge messages?
    – Wirsing
    Commented Feb 24, 2021 at 13:48
  • 17
    A default commit message template would be wonderful. The "Merged " prefix is pure clutter.
    – Tob
    Commented Feb 24, 2021 at 13:53
  • 11
    Direct link to the feature request.
    – Frédéric
    Commented Jan 4, 2022 at 18:32
  • 5
    @Frédéric That is a duplicate of this feature request, which also has more votes. (Seems like Microsoft has ignored this for years) developercommunity.visualstudio.com/t/…
    – spydon
    Commented Mar 7, 2022 at 13:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.