How to change PR merge commit message?

左心房为你撑大大i 提交于 2021-02-07 14:50:37

问题


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.


回答1:


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).



来源:https://stackoverflow.com/questions/55636169/how-to-change-pr-merge-commit-message

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!