OSDN Git Service

Update Help Document (Checkout, commit, check status)
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / tsvn_dug / dug_conflicts.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">\r
3 <sect1 id="tsvn-dug-conflicts">\r
4         <?dbhh topicname="HIDD_RESOLVE"?>\r
5         <title>Resolving Conflicts</title>\r
6         <indexterm>\r
7                 <primary>conflict</primary>\r
8         </indexterm>\r
9         <indexterm>\r
10                 <primary>resolve</primary>\r
11         </indexterm>\r
12         <para>\r
13                 Once in a while, you will get a <emphasis>conflict</emphasis> when\r
14                 you update your files from the repository. A conflict\r
15                 occurs when two or more developers have changed the same\r
16                 few lines of a file. As Git knows nothing of your\r
17                 project, it leaves resolving the conflicts to the developers.\r
18                 Whenever a conflict is reported, you should open the file in\r
19                 question, and search for lines starting with the string\r
20                 <literal>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</literal>.\r
21                 The conflicting area is marked like this:\r
22 <screen>\r
23 &lt;&lt;&lt;&lt;&lt;&lt;&lt; filename\r
24     your changes\r
25 =======\r
26     code merged from repository\r
27 &gt;&gt;&gt;&gt;&gt;&gt;&gt; revision\r
28 </screen>\r
29 <!--\r
30                 Also, for every conflicted file Git places three\r
31                 additional files in your directory:\r
32                 <variablelist>\r
33                         <varlistentry>\r
34                                 <term>filename.ext.mine</term>\r
35                                 <listitem>\r
36                                         <para>\r
37                                                 This is your file as it existed in your\r
38                                                 working copy before you updated your working copy\r
39                                                 - that is, without conflict markers. This file has\r
40                                                 your latest changes in it and nothing else.\r
41                                         </para>\r
42                                 </listitem>\r
43                         </varlistentry>\r
44                         <varlistentry>\r
45                                 <term>filename.ext.rOLDREV</term>\r
46                                 <listitem>\r
47                                         <para>\r
48                                                 This is the file that was the BASE\r
49                                                 revision before you updated your working copy. That is,\r
50                                                 it the file that you checked out before you made\r
51                                                 your latest edits.\r
52                                         </para>\r
53                                 </listitem>\r
54                         </varlistentry>\r
55                         <varlistentry>\r
56                                 <term>filename.ext.rNEWREV</term>\r
57                                 <listitem>\r
58                                         <para>\r
59                                                 This is the file that your Git\r
60                                                 client just received from the server when you updated\r
61                                                 your working copy. This file corresponds to the HEAD\r
62                                                 revision of the repository.\r
63                                         </para>\r
64                                 </listitem>\r
65                         </varlistentry>\r
66                 </variablelist>\r
67 -->\r
68         </para>\r
69         <para>\r
70                 You can launch an external merge tool / conflict\r
71                 editor with\r
72                 <menuchoice>\r
73                         <guimenu>TortoiseGit</guimenu>\r
74                         <guimenuitem>Edit Conflicts</guimenuitem>\r
75                 </menuchoice>\r
76                 or you can use any other editor to manually\r
77                 resolve the conflict. You should decide what the code\r
78                 should look like, do the necessary changes and save the file.\r
79         </para>\r
80         <para>\r
81                 Afterwards execute the command\r
82                 <menuchoice>\r
83                         <guimenu>TortoiseGit</guimenu>\r
84                         <guimenuitem>Resolved</guimenuitem>\r
85                 </menuchoice>\r
86                 and commit your modifications to the repository.\r
87                 Please note that the Resolve command does not really\r
88                 resolve the conflict. \r
89                 <!--\r
90                 It just removes the\r
91                 <filename>filename.ext.mine</filename> and\r
92                 <filename>filename.ext.r*</filename> files,\r
93                 -->\r
94                 I use "git add" to mark file status as resolved\r
95                 to allow you to commit your changes.\r
96         </para>\r
97         <para>\r
98                 If you have conflicts with binary files, Git does\r
99                 not attempt to merge the files itself. The local file remains\r
100                 unchanged (exactly as you last changed it) and you have\r
101                 <filename>filename.ext.r*</filename> files.\r
102                 If you want to discard your changes and keep the repository\r
103                 version, just use the Revert command. If you want to keep\r
104                 your version and overwrite the repository version, use the\r
105                 Resolved command, then commit your version.\r
106         </para>\r
107         <para>\r
108                 You can use the Resolved command for multiple files\r
109                 if you right click on the parent folder and select\r
110                 <menuchoice>\r
111                         <guimenu>TortoiseGit</guimenu>\r
112                         <guimenuitem>Resolved...</guimenuitem>\r
113                 </menuchoice>\r
114                 This will bring up a dialog listing all conflicted files\r
115                 in that folder, and you can select which ones to mark\r
116                 as resolved.\r
117         </para>\r
118 </sect1>\r