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
7 <primary>merge</primary>
\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
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
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
29 <guimenu>TortoiseGit</guimenu>
\r
30 <guimenuitem>Merge...</guimenuitem>
\r
32 <figure id="tsvn-dug-checkout-dia-1">
\r
33 <title>Merge dialog</title>
\r
34 <graphic fileref="../images/Merge.png"/>
\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
45 You can choose one commit that you want to merge from.
\r
46 <xi:include href="./dug_chooseversion.xml"/>
\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
54 <guilabel>No Fast Forward</guilabel> Generate a merge commit even if the
\r
55 merge resolved as a fast-forward.
\r
58 You can see more information at <xref linkend="git-merge(1)"/>
\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