I'm expecting Git to create a merge commit when I merge a signed or annotated tag but instead it fast-forwards the branch pointer. I'm using Git version 2.17.0 on openSUSE Tumbleweed that comes with it.
According to the manpage of
git-merge(1) it should create a merge commit in case of merging a signed/annotated tag:
--no-ff Create a merge commit even when the merge resolves as a fast-forward. This is the default behaviour when merging an annotated (and possibly signed) tag that is not stored in its natural place in refs/tags/ hierarchy.
The sequence of commands which I issued looks like this:
git init foobar cd foobar git commit --allow-empty -m 'Empty root commit' git checkout -b feature git commit --allow-empty -m 'Feature one commit ahead of master' git tag -a -m 'Feature ready for non fast-forward merge' ready-to-merge-feature git checkout master git merge ready-to-merge-feature
Unfortunately and unexpectedly the merge of the annotated tag
ready-to-merge-feature does result in a fast-forward merge instead of creating a merge commit. The same unexpected behavior I observe with a signed instead of an annotated tag.
Are my assumptions wrong? Am I doing something wrong? What would be a solution?