@matheusbsbs / matheus-bagliano / commits / 3746501664
Fork 0

Documentation: -merge and -pull: describe merge strategies.

... and give a couple of examples of running 'git pull' against local repository. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 4, 2005 at 00:06 UTC 3746501664e3fcf6c44080cb599b50bf9cbea2be
4 files changed +88 -11
Documentation/Makefile
+6 -1
@@ -52,10 +52,15 @@ install: man
52 # 'include' dependencies
53 $(patsubst %.txt,%.1,$(wildcard git-diff-*.txt)): \
54 diff-format.txt diff-options.txt
55 -$(patsubst %,%.1,git-fetch git-pull git-push): pull-fetch-param.txt
55 $(patsubst %.txt,%.html,$(wildcard git-diff-*.txt)): \
56 diff-format.txt diff-options.txt
57 +
58 +$(patsubst %,%.1,git-fetch git-pull git-push): pull-fetch-param.txt
59 $(patsubst %,%.html,git-fetch git-pull git-push): pull-fetch-param.txt
60 +
61 +$(patsubst %,%.1,git-merge git-pull): merge-pull-opts.txt
62 +$(patsubst %,%.html,git-merge git-pull): merge-pull-opts.txt
63 +
64 git.7: ../README
65
66 clean:
Documentation/git-merge.txt
+2 -9
@@ -8,7 +8,7 @@ git-merge - Grand Unified Merge Driver
8
9 SYNOPSIS
10 --------
11 -'git-merge' [-n] [-s <strategy>]... <msg> <head> <remote> <remote>...
11 +'git-merge' [-n] [--no-commit] [-s <strategy>]... <msg> <head> <remote> <remote>...
12
13
14 DESCRIPTION
@@ -19,14 +19,7 @@ which drives multiple merge strategy scripts.
19
20 OPTIONS
21 -------
22 --n::
23 - Do not show diffstat at the end of the merge.
24 -
25 --s <strategy>::
26 - use that merge strategy; can be given more than once to
27 - specify them in the order they should be tried. If
28 - there is no `-s` option, built-in list of strategies is
29 - used instead.
22 +include::merge-pull-opts.txt[]
23
24 <msg>::
25 The commit message to be used for the merge commit (in case
Documentation/git-pull.txt
+67 -1
@@ -8,7 +8,7 @@ git-pull - Pull and merge from another repository.
8
9 SYNOPSIS
10 --------
11 -'git-pull' <repository> <refspec>...
11 +'git-pull' <options> <repository> <refspec>...
12
13
14 DESCRIPTION
@@ -32,6 +32,72 @@ include::pull-fetch-param.txt[]
32 existing contents of $GIT_DIR/FETCH_HEAD. Without this
33 option old data in $GIT_DIR/FETCH_HEAD will be overwritten.
34
35 +include::merge-pull-opts.txt[]
36 +
37 +
38 +MERGE STRATEGIES
39 +----------------
40 +
41 +resolve::
42 + This can only resolve two heads (i.e. the current branch
43 + and another branch you pulled from) using 3-way merge
44 + algorithm. It tries to carefully detect criss-cross
45 + merge ambiguities and is considered generally safe and
46 + fast. This is the default merge strategy when pulling
47 + one branch.
48 +
49 +recursive::
50 + This can only resolve two heads using 3-way merge
51 + algorithm. When there are more than one common
52 + ancestors that can be used for 3-way merge, it creates a
53 + merged tree of the common ancestores and uses that as
54 + the reference tree for the 3-way merge. This has been
55 + reported to result in fewer merge conflicts without
56 + causing mis-merges by tests done on actual merge commits
57 + taken from Linux 2.6 kernel development history.
58 + Additionally this can detect and handle merges involving
59 + renames.
60 +
61 +octopus::
62 + This resolves more than two-head case, but refuses to do
63 + complex merge that needs manual resolution. It is
64 + primarily meant to be used for bundling topic branch
65 + heads together. This is the default merge strategy when
66 + pulling more than one branch.
67 +
68 +ours::
69 + This resolves any number of heads, but the result of the
70 + merge is always the current branch head. It is meant to
71 + be used to supersede old development history of side
72 + branches.
73 +
74 +
75 +EXAMPLES
76 +--------
77 +
78 +git pull, git pull origin::
79 + Fetch the default head from the repository you cloned
80 + from and merge it into your current branch.
81 +
82 +git pull -s ours . obsolete::
83 + Merge local branch `obsolete` into the current branch,
84 + using `ours` merge strategy.
85 +
86 +git pull . fixes enhancements::
87 + Bundle local branch `fixes` and `enhancements` on top of
88 + the current branch, making an Octopus merge.
89 +
90 +git pull --no-commit . maint::
91 + Merge local branch `maint` into the current branch, but
92 + do not make a commit automatically. This can be used
93 + when you want to include further changes to the merge,
94 + or want to write your own merge commit message.
95 ++
96 +You should refrain from abusing this option to sneak substantial
97 +changes into a merge commit. Small fixups like bumping
98 +release/version name would be acceptable.
99 +
100 +
101 Author
102 ------
103 Written by Linus Torvalds <torvalds@osdl.org>
Documentation/merge-pull-opts.txt new
+13
@@ -0,0 +1,13 @@
1 +-n, --no-summary::
2 + Do not show diffstat at the end of the merge.
3 +
4 +--no-commit::
5 + Perform the merge but pretend the merge failed and do
6 + not autocommit.
7 +
8 +-s <strategy>::
9 + use that merge strategy; can be given more than once to
10 + specify them in the order they should be tried. If
11 + there is no `-s` option, built-in list of strategies is
12 + used instead (`git-merge-resolve` when merging a single
13 + head, `git-merge-octopus` otherwise).