From bd2bc94252a47443e19d366f8cc9626d4f92df7a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 20 Dec 2021 14:53:43 -0800 Subject: merge: allow to pretend a merge is made into a different branch When a series of patches for a topic-B depends on having topic-A, the workflow to prepare the topic-B branch would look like this: $ git checkout -b topic-B main $ git merge --no-ff --no-edit topic-A $ git am " option to "git merge" and its underlying "git fmt-merge-message", to pretend as if we were merging into , no matter what branch we are actually merging into, when they prepare the merge message. The pretend name honors the usual "into " suppression mechanism, which can be seen in the tests added here. Signed-off-by: Junio C Hamano --- Documentation/git-merge.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Documentation/git-merge.txt') diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index e4f3352eb5..ed0990621f 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -12,7 +12,8 @@ SYNOPSIS 'git merge' [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] [--no-verify] [-s ] [-X ] [-S[]] [--[no-]allow-unrelated-histories] - [--[no-]rerere-autoupdate] [-m ] [-F ] [...] + [--[no-]rerere-autoupdate] [-m ] [-F ] + [--into-name ] [...] 'git merge' (--continue | --abort | --quit) DESCRIPTION @@ -76,6 +77,11 @@ The 'git fmt-merge-msg' command can be used to give a good default for automated 'git merge' invocations. The automated message can include the branch description. +--into-name :: + Prepare the default merge message as if merging to the branch + ``, instead of the name of the real branch to which + the merge is made. + -F :: --file=:: Read the commit message to be used for the merge commit (in -- cgit v1.3