@@ -20,20 +20,20 @@ DESCRIPTION
20
20
-----------
21
21
Incorporates changes from the named commits (since the time their
22
22
histories diverged from the current branch) into the current
23
- branch. This command is used by ' git pull' to incorporate changes
23
+ branch. This command is used by ` git pull` to incorporate changes
24
24
from another repository and can be used by hand to merge changes
25
25
from one branch into another.
26
26
27
27
Assume the following history exists and the current branch is
28
- " `master`" :
28
+ `master`:
29
29
30
30
------------
31
31
A---B---C topic
32
32
/
33
33
D---E---F---G master
34
34
------------
35
35
36
- Then " `git merge topic`" will replay the changes made on the
36
+ Then `git merge topic` will replay the changes made on the
37
37
`topic` branch since it diverged from `master` (i.e., `E`) until
38
38
its current commit (`C`) on top of `master`, and record the result
39
39
in a new commit along with the names of the two parent commits and
@@ -46,21 +46,21 @@ a log message from the user describing the changes. Before the operation,
46
46
D---E---F---G---H master
47
47
------------
48
48
49
- The second syntax ("`git merge --abort`") can only be run after the
50
- merge has resulted in conflicts. 'git merge --abort' will abort the
51
- merge process and try to reconstruct the pre-merge state. However,
52
- if there were uncommitted changes when the merge started (and
53
- especially if those changes were further modified after the merge
54
- was started), 'git merge --abort' will in some cases be unable to
55
- reconstruct the original (pre-merge) changes. Therefore:
49
+ A merge stops if there's a conflict that cannot be resolved
50
+ automatically or if `--no-commit` was provided when initiating the
51
+ merge. At that point you can run `git merge --abort` or `git merge
52
+ --continue`.
56
53
57
- *Warning*: Running 'git merge' with non-trivial uncommitted changes is
54
+ `git merge --abort` will abort the merge process and try to reconstruct
55
+ the pre-merge state. However, if there were uncommitted changes when the
56
+ merge started (and especially if those changes were further modified
57
+ after the merge was started), `git merge --abort` will in some cases be
58
+ unable to reconstruct the original (pre-merge) changes. Therefore:
59
+
60
+ *Warning*: Running `git merge` with non-trivial uncommitted changes is
58
61
discouraged: while possible, it may leave you in a state that is hard to
59
62
back out of in the case of a conflict.
60
63
61
- The third syntax ("`git merge --continue`") can only be run after the
62
- merge has resulted in conflicts.
63
-
64
64
OPTIONS
65
65
-------
66
66
:git-merge: 1
@@ -74,8 +74,8 @@ include::merge-options.txt[]
74
74
If `--log` is specified, a shortlog of the commits being merged
75
75
will be appended to the specified message.
76
76
+
77
- The ' git fmt-merge-msg' command can be
78
- used to give a good default for automated ' git merge'
77
+ The ` git fmt-merge-msg` command can be
78
+ used to give a good default for automated ` git merge`
79
79
invocations. The automated message can include the branch description.
80
80
81
81
--into-name <branch>::
@@ -104,14 +104,14 @@ include::rerere-options.txt[]
104
104
present, apply it to the worktree.
105
105
+
106
106
If there were uncommitted worktree changes present when the merge
107
- started, ' git merge --abort' will in some cases be unable to
107
+ started, ` git merge --abort` will in some cases be unable to
108
108
reconstruct these changes. It is therefore recommended to always
109
- commit or stash your changes before running ' git merge' .
109
+ commit or stash your changes before running ` git merge` .
110
110
+
111
- ' git merge --abort' is equivalent to ' git reset --merge' when
111
+ ` git merge --abort` is equivalent to ` git reset --merge` when
112
112
`MERGE_HEAD` is present unless `MERGE_AUTOSTASH` is also present in
113
- which case ' git merge --abort' applies the stash entry to the worktree
114
- whereas ' git reset --merge' will save the stashed changes in the stash
113
+ which case ` git merge --abort` applies the stash entry to the worktree
114
+ whereas ` git reset --merge` will save the stashed changes in the stash
115
115
list.
116
116
117
117
--quit::
@@ -120,8 +120,8 @@ list.
120
120
stash entry will be saved to the stash list.
121
121
122
122
--continue::
123
- After a ' git merge' stops due to conflicts you can conclude the
124
- merge by running ' git merge --continue' (see "HOW TO RESOLVE
123
+ After a ` git merge` stops due to conflicts you can conclude the
124
+ merge by running ` git merge --continue` (see "HOW TO RESOLVE
125
125
CONFLICTS" section below).
126
126
127
127
<commit>...::
@@ -144,25 +144,25 @@ PRE-MERGE CHECKS
144
144
Before applying outside changes, you should get your own work in
145
145
good shape and committed locally, so it will not be clobbered if
146
146
there are conflicts. See also linkgit:git-stash[1].
147
- ' git pull' and ' git merge' will stop without doing anything when
148
- local uncommitted changes overlap with files that ' git pull'/' git
149
- merge' may need to update.
147
+ ` git pull` and ` git merge` will stop without doing anything when
148
+ local uncommitted changes overlap with files that ` git pull`/` git
149
+ merge` may need to update.
150
150
151
151
To avoid recording unrelated changes in the merge commit,
152
- ' git pull' and ' git merge' will also abort if there are any changes
152
+ ` git pull` and ` git merge` will also abort if there are any changes
153
153
registered in the index relative to the `HEAD` commit. (Special
154
154
narrow exceptions to this rule may exist depending on which merge
155
155
strategy is in use, but generally, the index must match HEAD.)
156
156
157
- If all named commits are already ancestors of `HEAD`, ' git merge'
157
+ If all named commits are already ancestors of `HEAD`, ` git merge`
158
158
will exit early with the message "Already up to date."
159
159
160
160
FAST-FORWARD MERGE
161
161
------------------
162
162
163
163
Often the current branch head is an ancestor of the named commit.
164
- This is the most common case especially when invoked from ' git
165
- pull' : you are tracking an upstream repository, you have committed
164
+ This is the most common case especially when invoked from ` git
165
+ pull` : you are tracking an upstream repository, you have committed
166
166
no local changes, and now you want to update to a newer upstream
167
167
revision. In this case, a new commit is not needed to store the
168
168
combined history; instead, the `HEAD` (along with the index) is
@@ -269,7 +269,7 @@ Barbie's remark on your side. The only thing you can tell is that your
269
269
side wants to say it is hard and you'd prefer to go shopping, while the
270
270
other side wants to claim it is easy.
271
271
272
- An alternative style can be used by setting the " merge.conflictStyle"
272
+ An alternative style can be used by setting the ` merge.conflictStyle`
273
273
configuration variable to either "diff3" or "zdiff3". In "diff3"
274
274
style, the above conflict may look like this:
275
275
@@ -328,10 +328,10 @@ After seeing a conflict, you can do two things:
328
328
329
329
* Resolve the conflicts. Git will mark the conflicts in
330
330
the working tree. Edit the files into shape and
331
- ' git add' them to the index. Use ' git commit' or
332
- ' git merge --continue' to seal the deal. The latter command
331
+ ` git add` them to the index. Use ` git commit` or
332
+ ` git merge --continue` to seal the deal. The latter command
333
333
checks whether there is a (interrupted) merge in progress
334
- before calling ' git commit' .
334
+ before calling ` git commit` .
335
335
336
336
You can work through the conflict with a number of tools:
337
337
@@ -392,7 +392,7 @@ CONFIGURATION
392
392
393
393
branch.<name>.mergeOptions::
394
394
Sets default options for merging into branch <name>. The syntax and
395
- supported options are the same as those of ' git merge' , but option
395
+ supported options are the same as those of ` git merge` , but option
396
396
values containing whitespace characters are currently not supported.
397
397
398
398
include::includes/cmd-config-section-rest.txt[]
0 commit comments