Skip to content

Commit b40bb37

Browse files
jrntrast
authored andcommitted
Documentation: merge: add an overview
The reader unfamiliar with the concepts of branching and merging would have been completely lost. Try to help him with a diagram. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
1 parent a4081ba commit b40bb37

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

Documentation/git-merge.txt

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,32 @@ SYNOPSIS
1515

1616
DESCRIPTION
1717
-----------
18-
Merges the history specified by <commit> into HEAD, optionally using a
19-
specific merge strategy.
18+
Incorporates changes from the named commits (since the time their
19+
histories diverged from the current branch) into the current
20+
branch. This command is used by 'git pull' to incorporate changes
21+
from another repository and can be used by hand to merge changes
22+
from one branch into another.
23+
24+
Assume the following history exists and the current branch is
25+
"`master`":
26+
27+
------------
28+
A---B---C topic
29+
/
30+
D---E---F---G master
31+
------------
32+
33+
Then "`git merge topic`" will replay the changes made on the
34+
`topic` branch since it diverged from `master` (i.e., `E`) until
35+
its current commit (`C`) on top of `master`, and record the result
36+
in a new commit along with the names of the two parent commits and
37+
a log message from the user describing the changes.
38+
39+
------------
40+
A---B---C topic
41+
/ \
42+
D---E---F---G---H master
43+
------------
2044

2145
The second syntax (<msg> `HEAD` <commit>...) is supported for
2246
historical reasons. Do not use it from the command line or in

0 commit comments

Comments
 (0)