better document resolving conflicts
[TortoiseGit.git] / doc / source / en / TortoiseGit / tsvn_dug / dug_conflicts.xml
blob9880ddf1548dedff2bca4706727f947076dd9fe9
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         </para>\r
30         <para>\r
31                 You can launch an external merge tool / conflict\r
32                 editor with\r
33                 <menuchoice>\r
34                         <guimenu>TortoiseGit</guimenu>\r
35                         <guimenuitem>Edit Conflicts</guimenuitem>\r
36                 </menuchoice>\r
37                 or you can use any other editor to manually\r
38                 resolve the conflict. You should decide what the code\r
39                 should look like, do the necessary changes and save the file.\r
41                 For this, Git places three additional files in your directory for the selected conflicted file:\r
42                 <variablelist>\r
43                         <varlistentry>\r
44                                 <term>filename.ext.LOCAL.ext</term>\r
45                                 <listitem>\r
46                                         <para>\r
47                                                 This is your file as it existed in your\r
48                                                 working copy before you updated your working copy\r
49                                                 - that is, without conflict markers. This file has\r
50                                                 your latest changes in it and nothing else.\r
51                                         </para>\r
52                                 </listitem>\r
53                         </varlistentry>\r
54                         <varlistentry>\r
55                                 <term>filename.ext.BASE.ext</term>\r
56                                 <listitem>\r
57                                         <para>\r
58                                                 This is the file that was the BASE\r
59                                                 revision before you updated your working copy. That is,\r
60                                                 it the file that you checked out before you made\r
61                                                 your latest edits.\r
62                                         </para>\r
63                                 </listitem>\r
64                         </varlistentry>\r
65                         <varlistentry>\r
66                                 <term>filename.ext.REMOTE.ext</term>\r
67                                 <listitem>\r
68                                         <para>\r
69                                                 This is the file that your Git\r
70                                                 client just received from the server when you updated\r
71                                                 your working copy. This file corresponds to the HEAD\r
72                                                 revision of the repository.\r
73                                         </para>\r
74                                 </listitem>\r
75                         </varlistentry>\r
76                 </variablelist>\r
77         </para>\r
78         <para>\r
79                 Afterwards execute the command\r
80                 <menuchoice>\r
81                         <guimenu>TortoiseGit</guimenu>\r
82                         <guimenuitem>Resolved</guimenuitem>\r
83                 </menuchoice>\r
84                 and commit your modifications to the repository.\r
85                 Please note that the Resolve command does not really\r
86                 resolve the conflict. \r
87                 It uses "git add" to mark file status as resolved\r
88                 to allow you to commit your changes\r
89                 and it removes the\r
90                 <filename>filename.ext.BASE.ext</filename>,\r
91                 <filename>filename.ext.LOCAL.ext</filename> and\r
92                 <filename>filename.ext.REMOTE.ext</filename> files.\r
93         </para>\r
94         <para>\r
95                 If you have conflicts with binary files, Git does\r
96                 not attempt to merge the files itself. The local file remains\r
97                 unchanged (exactly as you last changed it) and you have\r
98                 <filename>filename.ext.BASE|LOCAL|REMOTE.ext</filename> files.\r
99                 If you want to discard your changes and keep the repository\r
100                 version, just use the Revert command. If you want to keep\r
101                 your version and overwrite the repository version, use the\r
102                 <guimenuitem>Resolved</guimenuitem> command, then commit your version.\r
103         </para>\r
104         <para>\r
105                 You can use the <guimenuitem>Resolved</guimenuitem> command for multiple files\r
106                 if you right click on the parent folder and select\r
107                 <menuchoice>\r
108                         <guimenu>TortoiseGit</guimenu>\r
109                         <guimenuitem>Resolve...</guimenuitem>\r
110                 </menuchoice>\r
111                 This will bring up a dialog listing all conflicted files\r
112                 in that folder, and you can select which ones to mark\r
113                 as resolved.\r
114                 <figure id="tsvn-dug-conflicts-dia-1">\r
115                         <title>The resolve conflicts dialog</title>\r
116                         <graphic fileref="../images/ResolveConflict.png"/>\r
117                 </figure>\r
118         </para>\r
119 </sect1>\r