OSDN Git Service

Replace TortoiseSVN with TortoiseGit
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseMerge / tme_basics.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE chapter SYSTEM "../../dtd/dblite.dtd">\r
3 <chapter id="tmerge-basics">\r
4         <title>Basic Concepts</title>\r
5         <simplesect>\r
6                 <para>\r
7                         TortoiseMerge has several different uses:\r
8                         <itemizedlist>\r
9                                 <listitem>\r
10                                         <para>\r
11                                                 Viewing the difference between two files and merging\r
12                                                 changes into one of them, or removing unwanted changes.\r
13                                         </para>\r
14                                 </listitem>\r
15                                 <listitem>\r
16                                         <para>\r
17                                                 Editing conflicts between local changes and changes in the\r
18                                                 Subversion repository following an update.\r
19                                         </para>\r
20                                 </listitem>\r
21                                 <listitem>\r
22                                         <para>\r
23                                                 Applying patch files. This is the reason TortoiseMerge\r
24                                                 was created :)\r
25                                         </para>\r
26                                 </listitem>\r
27                         </itemizedlist>\r
28                 </para>\r
29         </simplesect>\r
30         <sect1 id="tmerge-basics-diff">\r
31                 <title>Viewing and Merging Differences</title>\r
32                 <para>\r
33                         In this mode you are comparing two files. The file in the left pane\r
34                         is considered to be the original file (sometimes referred to as\r
35                         <emphasis>Theirs</emphasis>, and the file in the right pane is the\r
36                         modified file (sometimes referred to as <emphasis>Mine</emphasis>.\r
37                 </para>\r
38                 <para>\r
39                         You can make simple line-based changes to the file in the right pane\r
40                         which include:\r
41                         <itemizedlist>\r
42                                 <listitem>\r
43                                         <para>\r
44                                                 Reverting changed lines back to the text shown in the left pane.\r
45                                         </para>\r
46                                 </listitem>\r
47                                 <listitem>\r
48                                         <para>\r
49                                                 Using a combination of both blocks, either\r
50                                                 <emphasis>Theirs</emphasis> before <emphasis>Mine</emphasis> or\r
51                                                 <emphasis>Mine</emphasis> before <emphasis>Theirs</emphasis>.\r
52                                         </para>\r
53                                 </listitem>\r
54                         </itemizedlist>\r
55                 </para>\r
56                 <para>\r
57                         You can also edit the file in the right pane just as you would in a\r
58                         text editor. Such lines are marked using a pencil icon.\r
59                         Please note that if you want to make any of the line/block-based changes\r
60                         described above, it is better to do those first since once you start\r
61                         editing the file yourself it becomes impossible for TortoiseMerge to\r
62                         keep track of the relationship to the original files.\r
63                 </para>\r
64         </sect1>\r
65         <sect1 id="tmerge-basics-conflicts">\r
66                 <title>Editing Conflicts</title>\r
67                 <para>\r
68                         This is sometimes referred to as a three-way merge, and is shown in three panes.\r
69                         However there are actually four files involved. The file which is not shown is\r
70                         the common base file, the last common ancestor of the two files which are now\r
71                         in conflict. The relationships between the three files are explained in\r
72                         the diagram below:\r
73                 </para>\r
74                 <figure id="tmerge-dug-dia-conflict">\r
75                         <title>File Conflict</title>\r
76                         <graphic fileref="images/mergeprinciple.png"/>\r
77                 </figure>\r
78                 <para>\r
79                         The base file represents the oldest version of a file, from\r
80                         where <emphasis>You</emphasis> and <emphasis>They</emphasis> start\r
81                         making changes. <emphasis>Mine</emphasis> represents \r
82                         the base file with all the changes <emphasis>you</emphasis> made, \r
83                         and <emphasis>Theirs</emphasis> is the file with all the changes \r
84                         <emphasis>someone else</emphasis> made to the file.\r
85                         The left pane shows the changes in <emphasis>Theirs</emphasis>\r
86                         relative to the base file and the right pane shows the changes in\r
87                         <emphasis>Mine</emphasis> relative to the base file. The bottom pane is the\r
88                         output file which is where you are trying to resolve the conflicts.\r
89                 </para>\r
90                 <para>\r
91                         In conflict resolution view, you can choose to use blocks from\r
92                         <emphasis>Mine</emphasis> or <emphasis>Theirs</emphasis> or both.\r
93                         But in this case, the changes are shown in the bottom pane.\r
94                 </para>\r
95         </sect1>\r
96         <sect1 id="tmerge-basics-patch">\r
97                 <title>Applying Patches</title>\r
98                 <para>\r
99                         A patch file is a Subversion unified diff file, which contains\r
100                         the information required to apply changes to a set of files.\r
101                         The patch may have been supplied by another developer so that you\r
102                         can see changes he has made and possibly commit them to the repository.\r
103                         Or it may have been generated internally by TortoiseGit when comparing\r
104                         two folders. This happens when you compare a repository revision with\r
105                         your working copy folder, or if you compare two different repository\r
106                         revisions, or if you compare two different repository paths.\r
107                 </para>\r
108                 <para>\r
109                         In either case TortoiseMerge will show a small window listing the\r
110                         files included in the patch. By double clicking on one of these files\r
111                         you fetch the relevant file and apply the changes. The left pane shows\r
112                         the original file content and the right pane shows it after the patch\r
113                         is applied.\r
114                 </para>\r
115                 <para>\r
116                         You can edit the file in the right pane exactly as you would in\r
117                         compare/edit mode.\r
118                 </para>\r
119         </sect1>\r
120 </chapter>\r