OSDN Git Service

Add Git official document to help
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / git_doc / git-merge.html.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-merge(1)">\r
5 <articleinfo>\r
6     <title>git-merge(1)</title>\r
7         <indexterm>\r
8                 <primary>git-merge(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-merge - Join two or more development histories together</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git merge</emphasis> [-n] [--stat] [--no-commit] [--squash] [-s &lt;strategy&gt;]&#8230;\r
19         [-m &lt;msg&gt;] &lt;remote&gt; &lt;remote&gt;&#8230;\r
20 <emphasis>git merge</emphasis> &lt;msg&gt; HEAD &lt;remote&gt;&#8230;</literallayout>\r
21 </blockquote>\r
22 </simplesect>\r
23 <simplesect id="_description">\r
24 <title>DESCRIPTION</title>\r
25 <simpara>This is the top-level interface to the merge machinery\r
26 which drives multiple merge strategy scripts.</simpara>\r
27 <simpara>The second syntax (&lt;msg&gt; <literal>HEAD</literal> &lt;remote&gt;) is supported for\r
28 historical reasons.  Do not use it from the command line or in\r
29 new scripts.  It is the same as <literal>git merge -m &lt;msg&gt; &lt;remote&gt;</literal>.</simpara>\r
30 </simplesect>\r
31 <simplesect id="_options">\r
32 <title>OPTIONS</title>\r
33 <variablelist>\r
34 <varlistentry>\r
35 <term>\r
36 -q\r
37 </term>\r
38 <term>\r
39 --quiet\r
40 </term>\r
41 <listitem>\r
42 <simpara>\r
43         Operate quietly.\r
44 </simpara>\r
45 </listitem>\r
46 </varlistentry>\r
47 <varlistentry>\r
48 <term>\r
49 -v\r
50 </term>\r
51 <term>\r
52 --verbose\r
53 </term>\r
54 <listitem>\r
55 <simpara>\r
56         Be verbose.\r
57 </simpara>\r
58 </listitem>\r
59 </varlistentry>\r
60 <varlistentry>\r
61 <term>\r
62 --stat\r
63 </term>\r
64 <listitem>\r
65 <simpara>\r
66         Show a diffstat at the end of the merge. The diffstat is also\r
67         controlled by the configuration option merge.stat.\r
68 </simpara>\r
69 </listitem>\r
70 </varlistentry>\r
71 <varlistentry>\r
72 <term>\r
73 -n\r
74 </term>\r
75 <term>\r
76 --no-stat\r
77 </term>\r
78 <listitem>\r
79 <simpara>\r
80         Do not show a diffstat at the end of the merge.\r
81 </simpara>\r
82 </listitem>\r
83 </varlistentry>\r
84 <varlistentry>\r
85 <term>\r
86 --summary\r
87 </term>\r
88 <term>\r
89 --no-summary\r
90 </term>\r
91 <listitem>\r
92 <simpara>\r
93         Synonyms to --stat and --no-stat; these are deprecated and will be\r
94         removed in the future.\r
95 </simpara>\r
96 </listitem>\r
97 </varlistentry>\r
98 <varlistentry>\r
99 <term>\r
100 --log\r
101 </term>\r
102 <listitem>\r
103 <simpara>\r
104         In addition to branch names, populate the log message with\r
105         one-line descriptions from the actual commits that are being\r
106         merged.\r
107 </simpara>\r
108 </listitem>\r
109 </varlistentry>\r
110 <varlistentry>\r
111 <term>\r
112 --no-log\r
113 </term>\r
114 <listitem>\r
115 <simpara>\r
116         Do not list one-line descriptions from the actual commits being\r
117         merged.\r
118 </simpara>\r
119 </listitem>\r
120 </varlistentry>\r
121 <varlistentry>\r
122 <term>\r
123 --no-commit\r
124 </term>\r
125 <listitem>\r
126 <simpara>\r
127         Perform the merge but pretend the merge failed and do\r
128         not autocommit, to give the user a chance to inspect and\r
129         further tweak the merge result before committing.\r
130 </simpara>\r
131 </listitem>\r
132 </varlistentry>\r
133 <varlistentry>\r
134 <term>\r
135 --commit\r
136 </term>\r
137 <listitem>\r
138 <simpara>\r
139         Perform the merge and commit the result. This option can\r
140         be used to override --no-commit.\r
141 </simpara>\r
142 </listitem>\r
143 </varlistentry>\r
144 <varlistentry>\r
145 <term>\r
146 --squash\r
147 </term>\r
148 <listitem>\r
149 <simpara>\r
150         Produce the working tree and index state as if a real\r
151         merge happened, but do not actually make a commit or\r
152         move the <literal>HEAD</literal>, nor record <literal>$GIT_DIR/MERGE_HEAD</literal> to\r
153         cause the next <literal>git commit</literal> command to create a merge\r
154         commit.  This allows you to create a single commit on\r
155         top of the current branch whose effect is the same as\r
156         merging another branch (or more in case of an octopus).\r
157 </simpara>\r
158 </listitem>\r
159 </varlistentry>\r
160 <varlistentry>\r
161 <term>\r
162 --no-squash\r
163 </term>\r
164 <listitem>\r
165 <simpara>\r
166         Perform the merge and commit the result. This option can\r
167         be used to override --squash.\r
168 </simpara>\r
169 </listitem>\r
170 </varlistentry>\r
171 <varlistentry>\r
172 <term>\r
173 --no-ff\r
174 </term>\r
175 <listitem>\r
176 <simpara>\r
177         Generate a merge commit even if the merge resolved as a\r
178         fast-forward.\r
179 </simpara>\r
180 </listitem>\r
181 </varlistentry>\r
182 <varlistentry>\r
183 <term>\r
184 --ff\r
185 </term>\r
186 <listitem>\r
187 <simpara>\r
188         Do not generate a merge commit if the merge resolved as\r
189         a fast-forward, only update the branch pointer. This is\r
190         the default behavior of git-merge.\r
191 </simpara>\r
192 </listitem>\r
193 </varlistentry>\r
194 <varlistentry>\r
195 <term>\r
196 -s &lt;strategy&gt;\r
197 </term>\r
198 <term>\r
199 --strategy=&lt;strategy&gt;\r
200 </term>\r
201 <listitem>\r
202 <simpara>\r
203         Use the given merge strategy; can be supplied more than\r
204         once to specify them in the order they should be tried.\r
205         If there is no <literal>-s</literal> option, a built-in list of strategies\r
206         is used instead (<emphasis>git-merge-recursive</emphasis> when merging a single\r
207         head, <emphasis>git-merge-octopus</emphasis> otherwise).\r
208 </simpara>\r
209 </listitem>\r
210 </varlistentry>\r
211 <varlistentry>\r
212 <term>\r
213 -m &lt;msg&gt;\r
214 </term>\r
215 <listitem>\r
216 <simpara>\r
217         The commit message to be used for the merge commit (in case\r
218         it is created). The <emphasis>git-fmt-merge-msg</emphasis> script can be used\r
219         to give a good default for automated <emphasis>git-merge</emphasis> invocations.\r
220 </simpara>\r
221 </listitem>\r
222 </varlistentry>\r
223 <varlistentry>\r
224 <term>\r
225 &lt;remote&gt;&#8230;\r
226 </term>\r
227 <listitem>\r
228 <simpara>\r
229         Other branch heads to merge into our branch.  You need at\r
230         least one &lt;remote&gt;.  Specifying more than one &lt;remote&gt;\r
231         obviously means you are trying an Octopus.\r
232 </simpara>\r
233 </listitem>\r
234 </varlistentry>\r
235 </variablelist>\r
236 </simplesect>\r
237 <simplesect id="_merge_strategies">\r
238 <title>MERGE STRATEGIES</title>\r
239 <variablelist>\r
240 <varlistentry>\r
241 <term>\r
242 resolve\r
243 </term>\r
244 <listitem>\r
245 <simpara>\r
246         This can only resolve two heads (i.e. the current branch\r
247         and another branch you pulled from) using 3-way merge\r
248         algorithm.  It tries to carefully detect criss-cross\r
249         merge ambiguities and is considered generally safe and\r
250         fast.\r
251 </simpara>\r
252 </listitem>\r
253 </varlistentry>\r
254 <varlistentry>\r
255 <term>\r
256 recursive\r
257 </term>\r
258 <listitem>\r
259 <simpara>\r
260         This can only resolve two heads using 3-way merge\r
261         algorithm.  When there are more than one common\r
262         ancestors that can be used for 3-way merge, it creates a\r
263         merged tree of the common ancestors and uses that as\r
264         the reference tree for the 3-way merge.  This has been\r
265         reported to result in fewer merge conflicts without\r
266         causing mis-merges by tests done on actual merge commits\r
267         taken from Linux 2.6 kernel development history.\r
268         Additionally this can detect and handle merges involving\r
269         renames.  This is the default merge strategy when\r
270         pulling or merging one branch.\r
271 </simpara>\r
272 </listitem>\r
273 </varlistentry>\r
274 <varlistentry>\r
275 <term>\r
276 octopus\r
277 </term>\r
278 <listitem>\r
279 <simpara>\r
280         This resolves more than two-head case, but refuses to do\r
281         complex merge that needs manual resolution.  It is\r
282         primarily meant to be used for bundling topic branch\r
283         heads together.  This is the default merge strategy when\r
284         pulling or merging more than one branches.\r
285 </simpara>\r
286 </listitem>\r
287 </varlistentry>\r
288 <varlistentry>\r
289 <term>\r
290 ours\r
291 </term>\r
292 <listitem>\r
293 <simpara>\r
294         This resolves any number of heads, but the result of the\r
295         merge is always the current branch head.  It is meant to\r
296         be used to supersede old development history of side\r
297         branches.\r
298 </simpara>\r
299 </listitem>\r
300 </varlistentry>\r
301 <varlistentry>\r
302 <term>\r
303 subtree\r
304 </term>\r
305 <listitem>\r
306 <simpara>\r
307         This is a modified recursive strategy. When merging trees A and\r
308         B, if B corresponds to a subtree of A, B is first adjusted to\r
309         match the tree structure of A, instead of reading the trees at\r
310         the same level. This adjustment is also done to the common\r
311         ancestor tree.\r
312 </simpara>\r
313 </listitem>\r
314 </varlistentry>\r
315 </variablelist>\r
316 <simpara>If you tried a merge which resulted in a complex conflicts and\r
317 would want to start over, you can recover with <emphasis>git-reset</emphasis>.</simpara>\r
318 </simplesect>\r
319 <simplesect id="_configuration">\r
320 <title>CONFIGURATION</title>\r
321 <variablelist>\r
322 <varlistentry>\r
323 <term>\r
324 merge.conflictstyle\r
325 </term>\r
326 <listitem>\r
327 <simpara>\r
328         Specify the style in which conflicted hunks are written out to\r
329         working tree files upon merge.  The default is "merge", which\r
330         shows a <literal>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</literal> conflict marker, changes made by one side,\r
331         a <literal>=======</literal> marker, changes made by the other side, and then\r
332         a <literal>&gt;&gt;&gt;&gt;&gt;&gt;&gt;</literal> marker.  An alternate style, "diff3", adds a <literal>|||||||</literal>\r
333         marker and the original text before the <literal>=======</literal> marker.\r
334 </simpara>\r
335 </listitem>\r
336 </varlistentry>\r
337 <varlistentry>\r
338 <term>\r
339 merge.log\r
340 </term>\r
341 <listitem>\r
342 <simpara>\r
343         Whether to include summaries of merged commits in newly created\r
344         merge commit messages. False by default.\r
345 </simpara>\r
346 </listitem>\r
347 </varlistentry>\r
348 <varlistentry>\r
349 <term>\r
350 merge.renameLimit\r
351 </term>\r
352 <listitem>\r
353 <simpara>\r
354         The number of files to consider when performing rename detection\r
355         during a merge; if not specified, defaults to the value of\r
356         diff.renameLimit.\r
357 </simpara>\r
358 </listitem>\r
359 </varlistentry>\r
360 <varlistentry>\r
361 <term>\r
362 merge.stat\r
363 </term>\r
364 <listitem>\r
365 <simpara>\r
366         Whether to print the diffstat between ORIG_HEAD and the merge result\r
367         at the end of the merge.  True by default.\r
368 </simpara>\r
369 </listitem>\r
370 </varlistentry>\r
371 <varlistentry>\r
372 <term>\r
373 merge.tool\r
374 </term>\r
375 <listitem>\r
376 <simpara>\r
377         Controls which merge resolution program is used by\r
378         <xref linkend="git-mergetool(1)"/>.  Valid built-in values are: "kdiff3",\r
379         "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and\r
380         "opendiff".  Any other value is treated is custom merge tool\r
381         and there must be a corresponding mergetool.&lt;tool&gt;.cmd option.\r
382 </simpara>\r
383 </listitem>\r
384 </varlistentry>\r
385 <varlistentry>\r
386 <term>\r
387 merge.verbosity\r
388 </term>\r
389 <listitem>\r
390 <simpara>\r
391         Controls the amount of output shown by the recursive merge\r
392         strategy.  Level 0 outputs nothing except a final error\r
393         message if conflicts were detected. Level 1 outputs only\r
394         conflicts, 2 outputs conflicts and file changes.  Level 5 and\r
395         above outputs debugging information.  The default is level 2.\r
396         Can be overridden by the <emphasis>GIT_MERGE_VERBOSITY</emphasis> environment variable.\r
397 </simpara>\r
398 </listitem>\r
399 </varlistentry>\r
400 <varlistentry>\r
401 <term>\r
402 merge.&lt;driver&gt;.name\r
403 </term>\r
404 <listitem>\r
405 <simpara>\r
406         Defines a human-readable name for a custom low-level\r
407         merge driver.  See <xref linkend="gitattributes(5)"/> for details.\r
408 </simpara>\r
409 </listitem>\r
410 </varlistentry>\r
411 <varlistentry>\r
412 <term>\r
413 merge.&lt;driver&gt;.driver\r
414 </term>\r
415 <listitem>\r
416 <simpara>\r
417         Defines the command that implements a custom low-level\r
418         merge driver.  See <xref linkend="gitattributes(5)"/> for details.\r
419 </simpara>\r
420 </listitem>\r
421 </varlistentry>\r
422 <varlistentry>\r
423 <term>\r
424 merge.&lt;driver&gt;.recursive\r
425 </term>\r
426 <listitem>\r
427 <simpara>\r
428         Names a low-level merge driver to be used when\r
429         performing an internal merge between common ancestors.\r
430         See <xref linkend="gitattributes(5)"/> for details.\r
431 </simpara>\r
432 </listitem>\r
433 </varlistentry>\r
434 <varlistentry>\r
435 <term>\r
436 branch.&lt;name&gt;.mergeoptions\r
437 </term>\r
438 <listitem>\r
439 <simpara>\r
440         Sets default options for merging into branch &lt;name&gt;. The syntax and\r
441         supported options are equal to that of <emphasis>git-merge</emphasis>, but option values\r
442         containing whitespace characters are currently not supported.\r
443 </simpara>\r
444 </listitem>\r
445 </varlistentry>\r
446 </variablelist>\r
447 </simplesect>\r
448 <simplesect id="_how_merge_works">\r
449 <title>HOW MERGE WORKS</title>\r
450 <simpara>A merge is always between the current <literal>HEAD</literal> and one or more\r
451 commits (usually, branch head or tag), and the index file must\r
452 match the tree of <literal>HEAD</literal> commit (i.e. the contents of the last commit)\r
453 when it starts out.  In other words, <literal>git diff --cached HEAD</literal> must\r
454 report no changes.  (One exception is when the changed index\r
455 entries are already in the same state that would result from\r
456 the merge anyway.)</simpara>\r
457 <simpara>Three kinds of merge can happen:</simpara>\r
458 <itemizedlist>\r
459 <listitem>\r
460 <simpara>\r
461 The merged commit is already contained in <literal>HEAD</literal>. This is the\r
462   simplest case, called "Already up-to-date."\r
463 </simpara>\r
464 </listitem>\r
465 <listitem>\r
466 <simpara>\r
467 <literal>HEAD</literal> is already contained in the merged commit. This is the\r
468   most common case especially when invoked from <emphasis>git pull</emphasis>:\r
469   you are tracking an upstream repository, have committed no local\r
470   changes and now you want to update to a newer upstream revision.\r
471   Your <literal>HEAD</literal> (and the index) is updated to point at the merged\r
472   commit, without creating an extra merge commit.  This is\r
473   called "Fast-forward".\r
474 </simpara>\r
475 </listitem>\r
476 <listitem>\r
477 <simpara>\r
478 Both the merged commit and <literal>HEAD</literal> are independent and must be\r
479   tied together by a merge commit that has both of them as its parents.\r
480   The rest of this section describes this "True merge" case.\r
481 </simpara>\r
482 </listitem>\r
483 </itemizedlist>\r
484 <simpara>The chosen merge strategy merges the two commits into a single\r
485 new source tree.\r
486 When things merge cleanly, this is what happens:</simpara>\r
487 <orderedlist numeration="arabic">\r
488 <listitem>\r
489 <simpara>\r
490 The results are updated both in the index file and in your\r
491    working tree;\r
492 </simpara>\r
493 </listitem>\r
494 <listitem>\r
495 <simpara>\r
496 Index file is written out as a tree;\r
497 </simpara>\r
498 </listitem>\r
499 <listitem>\r
500 <simpara>\r
501 The tree gets committed; and\r
502 </simpara>\r
503 </listitem>\r
504 <listitem>\r
505 <simpara>\r
506 The <literal>HEAD</literal> pointer gets advanced.\r
507 </simpara>\r
508 </listitem>\r
509 </orderedlist>\r
510 <simpara>Because of 2., we require that the original state of the index\r
511 file matches exactly the current <literal>HEAD</literal> commit; otherwise we\r
512 will write out your local changes already registered in your\r
513 index file along with the merge result, which is not good.\r
514 Because 1. involves only those paths differing between your\r
515 branch and the remote branch you are pulling from during the\r
516 merge (which is typically a fraction of the whole tree), you can\r
517 have local modifications in your working tree as long as they do\r
518 not overlap with what the merge updates.</simpara>\r
519 <simpara>When there are conflicts, the following happens:</simpara>\r
520 <orderedlist numeration="arabic">\r
521 <listitem>\r
522 <simpara>\r
523 <literal>HEAD</literal> stays the same.\r
524 </simpara>\r
525 </listitem>\r
526 <listitem>\r
527 <simpara>\r
528 Cleanly merged paths are updated both in the index file and\r
529    in your working tree.\r
530 </simpara>\r
531 </listitem>\r
532 <listitem>\r
533 <simpara>\r
534 For conflicting paths, the index file records up to three\r
535    versions; stage1 stores the version from the common ancestor,\r
536    stage2 from <literal>HEAD</literal>, and stage3 from the remote branch (you\r
537    can inspect the stages with <literal>git ls-files -u</literal>).  The working\r
538    tree files contain the result of the "merge" program; i.e. 3-way\r
539    merge results with familiar conflict markers <literal>&lt;&lt;&lt; === &gt;&gt;&gt;</literal>.\r
540 </simpara>\r
541 </listitem>\r
542 <listitem>\r
543 <simpara>\r
544 No other changes are done.  In particular, the local\r
545    modifications you had before you started merge will stay the\r
546    same and the index entries for them stay as they were,\r
547    i.e. matching <literal>HEAD</literal>.\r
548 </simpara>\r
549 </listitem>\r
550 </orderedlist>\r
551 </simplesect>\r
552 <simplesect id="_how_conflicts_are_presented">\r
553 <title>HOW CONFLICTS ARE PRESENTED</title>\r
554 <simpara>During a merge, the working tree files are updated to reflect the result\r
555 of the merge.  Among the changes made to the common ancestor&#8217;s version,\r
556 non-overlapping ones (that is, you changed an area of the file while the\r
557 other side left that area intact, or vice versa) are incorporated in the\r
558 final result verbatim.  When both sides made changes to the same area,\r
559 however, git cannot randomly pick one side over the other, and asks you to\r
560 resolve it by leaving what both sides did to that area.</simpara>\r
561 <simpara>By default, git uses the same style as that is used by "merge" program\r
562 from the RCS suite to present such a conflicted hunk, like this:</simpara>\r
563 <literallayout>Here are lines that are either unchanged from the common\r
564 ancestor, or cleanly resolved because only one side changed.\r
565 &lt;&lt;&lt;&lt;&lt;&lt;&lt; yours:sample.txt\r
566 Conflict resolution is hard;\r
567 let's go shopping.\r
568 =======\r
569 Git makes conflict resolution easy.\r
570 &gt;&gt;&gt;&gt;&gt;&gt;&gt; theirs:sample.txt\r
571 And here is another line that is cleanly resolved or unmodified.</literallayout>\r
572 <simpara>The area where a pair of conflicting changes happened is marked with markers\r
573 "<literal>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</literal>", "<literal>=======</literal>", and "<literal>&gt;&gt;&gt;&gt;&gt;&gt;&gt;</literal>".  The part before the "<literal>=======</literal>"\r
574 is typically your side, and the part afterwards is typically their side.</simpara>\r
575 <simpara>The default format does not show what the original said in the conflicting\r
576 area.  You cannot tell how many lines are deleted and replaced with\r
577 Barbie&#8217;s remark on your side.  The only thing you can tell is that your\r
578 side wants to say it is hard and you&#8217;d prefer to go shopping, while the\r
579 other side wants to claim it is easy.</simpara>\r
580 <simpara>An alternative style can be used by setting the "merge.conflictstyle"\r
581 configuration variable to "diff3".  In "diff3" style, the above conflict\r
582 may look like this:</simpara>\r
583 <literallayout>Here are lines that are either unchanged from the common\r
584 ancestor, or cleanly resolved because only one side changed.\r
585 &lt;&lt;&lt;&lt;&lt;&lt;&lt; yours:sample.txt\r
586 Conflict resolution is hard;\r
587 let's go shopping.\r
588 |||||||\r
589 Conflict resolution is hard.\r
590 =======\r
591 Git makes conflict resolution easy.\r
592 &gt;&gt;&gt;&gt;&gt;&gt;&gt; theirs:sample.txt\r
593 And here is another line that is cleanly resolved or unmodified.</literallayout>\r
594 <simpara>In addition to the "<literal>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</literal>", "<literal>=======</literal>", and "<literal>&gt;&gt;&gt;&gt;&gt;&gt;&gt;</literal>" markers, it uses\r
595 another "<literal>|||||||</literal>" marker that is followed by the original text.  You can\r
596 tell that the original just stated a fact, and your side simply gave in to\r
597 that statement and gave up, while the other side tried to have a more\r
598 positive attitude.  You can sometimes come up with a better resolution by\r
599 viewing the original.</simpara>\r
600 </simplesect>\r
601 <simplesect id="_how_to_resolve_conflicts">\r
602 <title>HOW TO RESOLVE CONFLICTS</title>\r
603 <simpara>After seeing a conflict, you can do two things:</simpara>\r
604 <itemizedlist>\r
605 <listitem>\r
606 <simpara>\r
607 Decide not to merge.  The only clean-ups you need are to reset\r
608    the index file to the <literal>HEAD</literal> commit to reverse 2. and to clean\r
609    up working tree changes made by 2. and 3.; <emphasis>git-reset --hard</emphasis> can\r
610    be used for this.\r
611 </simpara>\r
612 </listitem>\r
613 <listitem>\r
614 <simpara>\r
615 Resolve the conflicts.  Git will mark the conflicts in\r
616    the working tree.  Edit the files into shape and\r
617    <emphasis>git-add</emphasis> them to the index.  Use <emphasis>git-commit</emphasis> to seal the deal.\r
618 </simpara>\r
619 </listitem>\r
620 </itemizedlist>\r
621 <simpara>You can work through the conflict with a number of tools:</simpara>\r
622 <itemizedlist>\r
623 <listitem>\r
624 <simpara>\r
625 Use a mergetool.  <emphasis>git mergetool</emphasis> to launch a graphical\r
626    mergetool which will work you through the merge.\r
627 </simpara>\r
628 </listitem>\r
629 <listitem>\r
630 <simpara>\r
631 Look at the diffs.  <emphasis>git diff</emphasis> will show a three-way diff,\r
632    highlighting changes from both the HEAD and remote versions.\r
633 </simpara>\r
634 </listitem>\r
635 <listitem>\r
636 <simpara>\r
637 Look at the diffs on their own. <emphasis>git log --merge -p &lt;path&gt;</emphasis>\r
638    will show diffs first for the HEAD version and then the\r
639    remote version.\r
640 </simpara>\r
641 </listitem>\r
642 <listitem>\r
643 <simpara>\r
644 Look at the originals.  <emphasis>git show :1:filename</emphasis> shows the\r
645    common ancestor, <emphasis>git show :2:filename</emphasis> shows the HEAD\r
646    version and <emphasis>git show :3:filename</emphasis> shows the remote version.\r
647 </simpara>\r
648 </listitem>\r
649 </itemizedlist>\r
650 </simplesect>\r
651 <simplesect id="_see_also">\r
652 <title>SEE ALSO</title>\r
653 <simpara><xref linkend="git-fmt-merge-msg(1)"/>, <xref linkend="git-pull(1)"/>,\r
654 <xref linkend="gitattributes(5)"/>,\r
655 <xref linkend="git-reset(1)"/>,\r
656 <xref linkend="git-diff(1)"/>, <xref linkend="git-ls-files(1)"/>,\r
657 <xref linkend="git-add(1)"/>, <xref linkend="git-rm(1)"/>,\r
658 <xref linkend="git-mergetool(1)"/></simpara>\r
659 </simplesect>\r
660 <simplesect id="_author">\r
661 <title>Author</title>\r
662 <simpara>Written by Junio C Hamano &lt;<ulink url="mailto:gitster@pobox.com">gitster@pobox.com</ulink>&gt;</simpara>\r
663 </simplesect>\r
664 <simplesect id="_documentation">\r
665 <title>Documentation</title>\r
666 <simpara>Documentation by Junio C Hamano and the git-list &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;.</simpara>\r
667 </simplesect>\r
668 <simplesect id="_git">\r
669 <title>GIT</title>\r
670 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
671 </simplesect>\r
672 </article>\r