Update document
[TortoiseGit.git] / doc / source / en / TortoiseGit / tsvn_dug / dug_merge.xml
blobcb31e637a3dbf861d35628da60b1d2a4b3dc5f64
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">\r
3 <sect1 id="tsvn-dug-merge" xmlns:xi="http://www.w3.org/2001/XInclude">\r
4         <title>Merging</title>\r
5         <?dbhh topicname="HIDD_MERGE"?>\r
6         <indexterm>\r
7                 <primary>merge</primary>\r
8         </indexterm>\r
9         <para>\r
10                 Where branches are used to maintain separate lines of development,\r
11                 at some stage you will want to merge the changes made on one branch\r
12                 back into the other branch, or vice versa.\r
13         </para>\r
14         <para>\r
15                 It is important to understand how branching and merging works in\r
16                 Git before you start using it, as it can become quite complex.\r
17                 It is highly recommended that you read the chapter\r
18                 <xref linkend="Basic_Branching_and_Mergin"/>\r
19                 in the Git book, which gives a full description and many \r
20                 examples of how it is used.\r
21         </para>\r
22         <para>\r
23                 The next point to note is that merging <emphasis>always</emphasis>\r
24                 takes place within a working copy. If you want to merge changes\r
25                 <emphasis>into</emphasis> a branch, you have to have a working copy\r
26                 for that branch checked out, and invoke the merge wizard from that\r
27                 working copy using\r
28                 <menuchoice>\r
29                         <guimenu>TortoiseGit</guimenu>\r
30                         <guimenuitem>Merge...</guimenuitem>\r
31                 </menuchoice>.\r
32                 <figure id="tsvn-dug-checkout-dia-1">\r
33                         <title>Merge dialog</title>\r
34                         <graphic fileref="../images/Merge.png"/>\r
35                 </figure>\r
36         </para>\r
37         <para>\r
38                 In general it is a good idea to perform a merge into an unmodified\r
39                 working copy. If you have made other changes in your WC, commit those\r
40                 first. If the merge does not go as you expect, you may want to revert\r
41                 the changes, and the <guilabel>Revert</guilabel> command will discard\r
42                 <emphasis>all</emphasis> changes including any you made before the merge.\r
43         </para>\r
44         <para>\r
45                 You can choose one commit that you want to merge from. \r
46                 <xi:include href="./dug_chooseversion.xml"/> \r
47         </para>\r
48         <para>\r
49                 <guilabel>Squash</guilabel> Just merge change from the other branch. Can't\r
50                 recorder Merge information. The new commit will not record merge branch as\r
51                 one parent commit. Log view will not show merge line between two branch. \r
52         </para>\r
53         <para>\r
54                 <guilabel>No Fast Forward</guilabel> Generate a merge commit even if the\r
55                 merge resolved as a fast-forward.\r
56         </para>\r
57         <para>\r
58                 You can see more information at <xref linkend="git-merge(1)"/>\r
59         </para>\r
60         <para>\r
61                 Although major merge working is done by git automatically, conflict maybe happen during merge, \r
62                 please see <xref linked="tsvn-dug-conflicts"/> to how to resolve conflict.\r
63         </para>\r
64 </sect1>\r