@matheusbsbs / matheus-bagliano / commits / 33a59fd07d
Fork 0

Documentation: update git-pull.txt for new clone behavior

Update examples, stop using branch named "origin" as an example. Remove large example of use of remotes; that particular case is nicely automated by default, so it's not so pressing to explain, and we can refer to git-repo-config for the details. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>

J. Bruce Fields committed Jan 1, 2007 at 16:39 UTC 33a59fd07d8d75e58a5b1edbcc3c5798c98aa8bf
1 file changed +25 -44
Documentation/git-pull.txt
+25 -44
@@ -37,17 +37,27 @@ EXAMPLES
37 --------
38
39 git pull, git pull origin::
40 - Fetch the default head from the repository you cloned
41 - from and merge it into your current branch.
42 -
43 -git pull -s ours . obsolete::
44 - Merge local branch `obsolete` into the current branch,
45 - using `ours` merge strategy.
40 + Update the remote-tracking branches for the repository
41 + you cloned from, then merge one of them into your
42 + current branch. Normally the branch merged in is
43 + the HEAD of the remote repository, but the choice is
44 + determined by the branch.<name>.remote and
45 + branch.<name>.merge options; see gitlink:git-repo-config[1]
46 + for details.
47 +
48 +git pull origin next::
49 + Merge into the current branch the remote branch `next`;
50 + leaves a copy of `next` temporarily in FETCH_HEAD, but
51 + does not update any remote-tracking branches.
52
53 git pull . fixes enhancements::
54 Bundle local branch `fixes` and `enhancements` on top of
55 the current branch, making an Octopus merge.
56
57 +git pull -s ours . obsolete::
58 + Merge local branch `obsolete` into the current branch,
59 + using `ours` merge strategy.
60 +
61 git pull --no-commit . maint::
62 Merge local branch `maint` into the current branch, but
63 do not make a commit automatically. This can be used
@@ -61,48 +71,19 @@ release/version name would be acceptable.
71 Command line pull of multiple branches from one repository::
72 +
73 ------------------------------------------------
64 -$ cat .git/remotes/origin
65 -URL: git://git.kernel.org/pub/scm/git/git.git
66 -Pull: master:origin
67 -
74 $ git checkout master
69 -$ git fetch origin master:origin +pu:pu maint:maint
70 -$ git pull . origin
75 +$ git fetch origin +pu:pu maint:tmp
76 +$ git pull . tmp
77 ------------------------------------------------
78 +
73 -Here, a typical `.git/remotes/origin` file from a
74 -`git-clone` operation is used in combination with
75 -command line options to `git-fetch` to first update
76 -multiple branches of the local repository and then
77 -to merge the remote `origin` branch into the local
78 -`master` branch. The local `pu` branch is updated
79 -even if it does not result in a fast forward update.
80 -Here, the pull can obtain its objects from the local
81 -repository using `.`, as the previous `git-fetch` is
82 -known to have already obtained and made available
83 -all the necessary objects.
84 -
85 -
86 -Pull of multiple branches from one repository using `.git/remotes` file::
79 +This updates (or creates, as necessary) branches `pu` and `tmp`
80 +in the local repository by fetching from the branches
81 +(respectively) `pu` and `maint` from the remote repository.
82 +
88 -------------------------------------------------
89 -$ cat .git/remotes/origin
90 -URL: git://git.kernel.org/pub/scm/git/git.git
91 -Pull: master:origin
92 -Pull: +pu:pu
93 -Pull: maint:maint
94 -
95 -$ git checkout master
96 -$ git pull origin
97 -------------------------------------------------
83 +The `pu` branch will be updated even if it is does not
84 +fast-forward; the others will not be.
85 +
99 -Here, a typical `.git/remotes/origin` file from a
100 -`git-clone` operation has been hand-modified to include
101 -the branch-mapping of additional remote and local
102 -heads directly. A single `git-pull` operation while
103 -in the `master` branch will fetch multiple heads and
104 -merge the remote `origin` head into the current,
105 -local `master` branch.
86 +The final command then merges the newly fetched `tmp` into master.
87
88
89 If you tried a pull which resulted in a complex conflicts and
@@ -112,7 +93,7 @@ gitlink:git-reset[1].
93
94 SEE ALSO
95 --------
115 -gitlink:git-fetch[1], gitlink:git-merge[1]
96 +gitlink:git-fetch[1], gitlink:git-merge[1], gitlink:git-repo-config[1]
97
98
99 Author