path: root/Documentation/git-merge.txt
diff options
authorJunio C Hamano <>2013-03-21 21:57:48 (GMT)
committerJunio C Hamano <>2013-03-21 22:47:38 (GMT)
commit77c72780edfa5e3858423366fc91699724793b39 (patch)
treea99b3e5cd412ea5ddd2c4119d5c88d49d3dbabec /Documentation/git-merge.txt
parent5d417842efeafb6e109db7574196901c4e95d273 (diff)
Documentation: merging a tag is a special case
When asking Git to merge a tag (such as a signed tag or annotated tag), it will always create a merge commit even if fast-forward was possible. It's like having --no-ff present on the command line. It's a difference from the default behavior described in git-merge.txt. It should be documented as an exception of "FAST-FORWARD MERGE" section and "--ff" option description. Reviewed-by: Jonathan Nieder <> Reviewed-by: Yann Droneaud <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-merge.txt')
1 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index d34ea3c..7780863 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -170,6 +170,30 @@ happens:
If you tried a merge which resulted in complex conflicts and
want to start over, you can recover with `git merge --abort`.
+When merging an annotated (and possibly signed) tag, Git always
+creates a merge commit even if a fast-forward merge is possible, and
+the commit message template is prepared with the tag message.
+Additionally, if the tag is signed, the signature check is reported
+as a comment in the message template. See also linkgit:git-tag[1].
+When you want to just integrate with the work leading to the commit
+that happens to be tagged, e.g. synchronizing with an upstream
+release point, you may not want to make an unnecessary merge commit.
+In such a case, you can "unwrap" the tag yourself before feeding it
+to `git merge`, or pass `--ff-only` when you do not have any work on
+your own. e.g.
+git fetch origin
+git merge v1.2.3^0
+git merge --ff-only v1.2.3