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.
On the command line, navigate to the repository that contains the commit you want to amend. Use the git rebase -i HEAD~n command to display a list of the last n commits in your default text editor. Replace pick with reword before each commit message you want to change.
Changing the latest Git commit message If the message to be changed is for the latest commit to the repository, then the following commands are to be executed: git commit --amend -m "New message" git push --force repository-name branch-name.
How to Undo a Merge Commit in Git. You can use the Git reset command to undo a merge. Firstly, you need to check for the commit hash (or id) so you can use it to go back to the previous commit. To check for the hash, run git log or git reflog .
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With