blob: 80d4831662c5e5fee9cdcc37e14929ce94f9b81a [file] [log] [blame]
Junio C Hamanoc21ab052009-10-31 04:03:551--commit::
2--no-commit::
3Perform the merge and commit the result. This option can
4be used to override --no-commit.
5+
Junio C Hamano11f15372019-03-07 03:17:006With --no-commit perform the merge and stop just before creating
7a merge commit, to give the user a chance to inspect and further
8tweak the merge result before committing.
9+
10Note that fast-forward updates do not create a merge commit and
11therefore there is no way to stop those merges with --no-commit.
12Thus, if you want to ensure your branch is not changed or updated
13by the merge command, use --no-ff with --no-commit.
Junio C Hamano610d1762008-11-28 06:27:1314
Junio C Hamano11821ed2011-10-19 18:42:0915--edit::
Junio C Hamano7e590a12013-06-02 23:46:5216-e::
Junio C Hamano795a5a32012-02-02 01:36:3717--no-edit::
18Invoke an editor before committing successful mechanical merge to
19further edit the auto-generated merge message, so that the user
20can explain and justify the merge. The `--no-edit` option can be
21used to accept the auto-generated message (this is generally
Junio C Hamanoc5bd79e2014-01-27 21:31:2622discouraged).
23ifndef::git-pull[]
24The `--edit` (or `-e`) option is still useful if you are
25giving a draft message with the `-m` option from the command line
26and want to edit it in the editor.
27endif::git-pull[]
Junio C Hamano795a5a32012-02-02 01:36:3728+
29Older scripts may depend on the historical behaviour of not allowing the
30user to edit the merge log message. They will see an editor opened when
31they run `git merge`. To make it easier to adjust such scripts to the
32updated behaviour, the environment variable `GIT_MERGE_AUTOEDIT` can be
33set to `no` at the beginning of them.
Junio C Hamano11821ed2011-10-19 18:42:0934
Junio C Hamanod1063b12019-05-08 17:18:0735--cleanup=<mode>::
36This option determines how the merge message will be cleaned up before
Junio C Hamano8ef91f32019-12-01 22:58:2737committing. See linkgit:git-commit[1] for more details. In addition, if
Junio C Hamanod1063b12019-05-08 17:18:0738the '<mode>' is given a value of `scissors`, scissors will be appended
39to `MERGE_MSG` before being passed on to the commit machinery in the
40case of a merge conflict.
41
Junio C Hamanoc21ab052009-10-31 04:03:5542--ff::
43--no-ff::
Junio C Hamanof54f08e2012-02-27 07:49:1944--ff-only::
Junio C Hamanoa8858312019-09-30 05:07:4545Specifies how a merge is handled when the merged-in history is
46already a descendant of the current history. `--ff` is the
47default unless merging an annotated (and possibly signed) tag
48that is not stored in its natural place in the `refs/tags/`
49hierarchy, in which case `--no-ff` is assumed.
50+
51With `--ff`, when possible resolve the merge as a fast-forward (only
52update the branch pointer to match the merged branch; do not create a
53merge commit). When not possible (when the merged-in history is not a
54descendant of the current history), create a merge commit.
55+
56With `--no-ff`, create a merge commit in all cases, even when the merge
57could instead be resolved as a fast-forward.
58+
59With `--ff-only`, resolve the merge as a fast-forward when possible.
60When not possible, refuse to merge and exit with a non-zero status.
Junio C Hamano6d76d612008-05-09 05:46:0861
Junio C Hamanof7e3f472017-10-20 06:45:2462-S[<keyid>]::
63--gpg-sign[=<keyid>]::
Junio C Hamano67bf2242020-04-22 21:41:4464--no-gpg-sign::
Junio C Hamanof7e3f472017-10-20 06:45:2465GPG-sign the resulting merge commit. The `keyid` argument is
66optional and defaults to the committer identity; if specified,
Junio C Hamano67bf2242020-04-22 21:41:4467it must be stuck to the option without a space. `--no-gpg-sign`
68is useful to countermand both `commit.gpgSign` configuration variable,
69and earlier `--gpg-sign`.
Junio C Hamanof7e3f472017-10-20 06:45:2470
Junio C Hamano3b4609d2010-09-30 00:04:3471--log[=<n>]::
Junio C Hamanoc21ab052009-10-31 04:03:5572--no-log::
Junio C Hamano6d76d612008-05-09 05:46:0873In addition to branch names, populate the log message with
Junio C Hamano3b4609d2010-09-30 00:04:3474one-line descriptions from at most <n> actual commits that are being
75merged. See also linkgit:git-fmt-merge-msg[1].
Junio C Hamanoc21ab052009-10-31 04:03:5576+
77With --no-log do not list one-line descriptions from the
78actual commits being merged.
Junio C Hamano6d76d612008-05-09 05:46:0879
Junio C Hamano3a9c0342017-11-10 06:01:1280--signoff::
81--no-signoff::
82Add Signed-off-by line by the committer at the end of the commit
83log message. The meaning of a signoff depends on the project,
84but it typically certifies that committer has
85the rights to submit this work under the same license and
86agrees to a Developer Certificate of Origin
87(see http://developercertificate.org/ for more information).
88+
89With --no-signoff do not add a Signed-off-by line.
Junio C Hamano6d76d612008-05-09 05:46:0890
Junio C Hamanoc21ab052009-10-31 04:03:5591--stat::
92-n::
93--no-stat::
94Show a diffstat at the end of the merge. The diffstat is also
95controlled by the configuration option merge.stat.
96+
97With -n or --no-stat do not show a diffstat at the end of the
98merge.
Junio C Hamano1b50ce92007-10-03 12:05:5399
Junio C Hamano3901ffb2006-06-26 23:46:53100--squash::
Junio C Hamanoc21ab052009-10-31 04:03:55101--no-squash::
Junio C Hamanod75148a2014-04-08 19:48:38102Produce the working tree and index state as if a real merge
103happened (except for the merge information), but do not actually
104make a commit, move the `HEAD`, or record `$GIT_DIR/MERGE_HEAD`
105(to cause the next `git commit` command to create a merge
106commit). This allows you to create a single commit on top of
107the current branch whose effect is the same as merging another
108branch (or more in case of an octopus).
Junio C Hamanoc21ab052009-10-31 04:03:55109+
110With --no-squash perform the merge and commit the result. This
111option can be used to override --squash.
Junio C Hamano73c64862019-06-18 03:24:20112+
113With --squash, --commit is not allowed, and will fail.
Junio C Hamano1b50ce92007-10-03 12:05:53114
Junio C Hamanocb705392019-09-18 19:30:01115--no-verify::
116This option bypasses the pre-merge and commit-msg hooks.
117See also linkgit:githooks[5].
118
Junio C Hamanoeb415992008-06-08 22:49:47119-s <strategy>::
120--strategy=<strategy>::
Junio C Hamano1a4e8412005-12-27 08:17:23121Use the given merge strategy; can be supplied more than
122once to specify them in the order they should be tried.
123If there is no `-s` option, a built-in list of strategies
Junio C Hamano1aa40d22010-01-21 17:46:43124is used instead ('git merge-recursive' when merging a single
125head, 'git merge-octopus' otherwise).
Junio C Hamanoc21ab052009-10-31 04:03:55126
Junio C Hamanob04bb3f2010-04-14 14:07:36127-X <option>::
128--strategy-option=<option>::
129Pass merge strategy specific option through to the merge
130strategy.
131
Junio C Hamanoedf80bd2013-04-05 22:14:36132--verify-signatures::
133--no-verify-signatures::
Junio C Hamano198b1f12016-05-17 22:27:24134Verify that the tip commit of the side branch being merged is
135signed with a valid key, i.e. a key that has a valid uid: in the
136default trust model, this means the signing key has been signed by
137a trusted key. If the tip commit of the side branch is not signed
138with a valid key, the merge is aborted.
Junio C Hamanoedf80bd2013-04-05 22:14:36139
Junio C Hamanoc21ab052009-10-31 04:03:55140--summary::
141--no-summary::
142Synonyms to --stat and --no-stat; these are deprecated and will be
143removed in the future.
144
Junio C Hamanoea90ab32010-03-15 20:32:55145ifndef::git-pull[]
Junio C Hamanoc21ab052009-10-31 04:03:55146-q::
147--quiet::
Junio C Hamanod2c978f2011-03-20 19:42:22148Operate quietly. Implies --no-progress.
Junio C Hamanoc21ab052009-10-31 04:03:55149
150-v::
151--verbose::
152Be verbose.
Junio C Hamanod2c978f2011-03-20 19:42:22153
154--progress::
155--no-progress::
156Turn progress on/off explicitly. If neither is specified,
157progress is shown if standard error is connected to a terminal.
158Note that not all merge strategies may support progress
159reporting.
160
Junio C Hamanoea90ab32010-03-15 20:32:55161endif::git-pull[]
Junio C Hamano7921e7c2016-04-29 21:55:09162
Junio C Hamano67cc2b72020-04-30 00:03:20163--autostash::
164--no-autostash::
165Automatically create a temporary stash entry before the operation
166begins, and apply it after the operation ends. This means
167that you can run the operation on a dirty worktree. However, use
168with care: the final stash application after a successful
169merge might result in non-trivial conflicts.
170
Junio C Hamano7921e7c2016-04-29 21:55:09171--allow-unrelated-histories::
172By default, `git merge` command refuses to merge histories
173that do not share a common ancestor. This option can be
174used to override this safety when merging histories of two
175projects that started their lives independently. As that is
176a very rare occasion, no configuration variable to enable
177this by default exists and will not be added.