documentation: move git(7) to git(1)
[git.git] / Documentation / git-pull.txt
index f7b90a326f8e244c2c9df286bb63afc655c67318..5c522ced980dd2d457608f37de725bc13eb5b855 100644 (file)
@@ -15,6 +15,7 @@ DESCRIPTION
 -----------
 Runs `git-fetch` with the given parameters, and calls `git-merge`
 to merge the retrieved head(s) into the current branch.
+With `--rebase`, calls `git-rebase` instead of `git-merge`.
 
 Note that you can use `.` (current directory) as the
 <repository> to pull from the local repository -- this is useful
@@ -28,19 +29,14 @@ OPTIONS
 include::merge-options.txt[]
 
 :git-pull: 1
-include::fetch-options.txt[]
-
-include::pull-fetch-param.txt[]
-
-include::urls-remotes.txt[]
-
-include::merge-strategies.txt[]
 
 \--rebase::
        Instead of a merge, perform a rebase after fetching.  If
        there is a remote ref for the upstream branch, and this branch
        was rebased since last fetched, the rebase uses that information
-       to avoid rebasing non-local changes.
+       to avoid rebasing non-local changes. To make this the default
+       for branch `<name>`, set configuration `branch.<name>.rebase`
+       to `true`.
 +
 *NOTE:* This is a potentially _dangerous_ mode of operation.
 It rewrites history, which does not bode well when you
@@ -50,6 +46,14 @@ unless you have read linkgit:git-rebase[1] carefully.
 \--no-rebase::
        Override earlier \--rebase.
 
+include::fetch-options.txt[]
+
+include::pull-fetch-param.txt[]
+
+include::urls-remotes.txt[]
+
+include::merge-strategies.txt[]
+
 DEFAULT BEHAVIOUR
 -----------------
 
@@ -107,40 +111,58 @@ rules apply:
 EXAMPLES
 --------
 
-git pull, git pull origin::
-       Update the remote-tracking branches for the repository
-       you cloned from, then merge one of them into your
-       current branch.  Normally the branch merged in is
-       the HEAD of the remote repository, but the choice is
-       determined by the branch.<name>.remote and
-       branch.<name>.merge options; see linkgit:git-config[1]
-       for details.
-
-git pull origin next::
-       Merge into the current branch the remote branch `next`;
-       leaves a copy of `next` temporarily in FETCH_HEAD, but
-       does not update any remote-tracking branches.
-
-git pull . fixes enhancements::
-       Bundle local branch `fixes` and `enhancements` on top of
-       the current branch, making an Octopus merge.  This `git pull .`
-       syntax is equivalent to `git merge`.
-
-git pull -s ours . obsolete::
-       Merge local branch `obsolete` into the current branch,
-       using `ours` merge strategy.
-
-git pull --no-commit . maint::
-       Merge local branch `maint` into the current branch, but
-       do not make a commit automatically.  This can be used
-       when you want to include further changes to the merge,
-       or want to write your own merge commit message.
+* Update the remote-tracking branches for the repository
+  you cloned from, then merge one of them into your
+  current branch:
++
+------------------------------------------------
+$ git pull, git pull origin
+------------------------------------------------
++
+Normally the branch merged in is the HEAD of the remote repository,
+but the choice is determined by the branch.<name>.remote and
+branch.<name>.merge options; see linkgit:git-config[1] for details.
+
+* Merge into the current branch the remote branch `next`:
++
+------------------------------------------------
+$ git pull origin next
+------------------------------------------------
++
+This leaves a copy of `next` temporarily in FETCH_HEAD, but
+does not update any remote-tracking branches.
+
+* Bundle local branch `fixes` and `enhancements` on top of
+  the current branch, making an Octopus merge:
++
+------------------------------------------------
+$ git pull . fixes enhancements
+------------------------------------------------
++
+This `git pull .` syntax is equivalent to `git merge`.
+
+* Merge local branch `obsolete` into the current branch, using `ours`
+  merge strategy:
++
+------------------------------------------------
+$ git pull -s ours . obsolete
+------------------------------------------------
+
+* Merge local branch `maint` into the current branch, but do not make
+  a commit automatically:
++
+------------------------------------------------
+$ git pull --no-commit . maint
+------------------------------------------------
++
+This can be used when you want to include further changes to the
+merge, or want to write your own merge commit message.
 +
 You should refrain from abusing this option to sneak substantial
 changes into a merge commit.  Small fixups like bumping
 release/version name would be acceptable.
 
-Command line pull of multiple branches from one repository::
+* Command line pull of multiple branches from one repository:
 +
 ------------------------------------------------
 $ git checkout master
@@ -148,12 +170,12 @@ $ git fetch origin +pu:pu maint:tmp
 $ git pull . tmp
 ------------------------------------------------
 +
-This updates (or creates, as necessary) branches `pu` and `tmp`
-in the local repository by fetching from the branches
-(respectively) `pu` and `maint` from the remote repository.
+This updates (or creates, as necessary) branches `pu` and `tmp` in
+the local repository by fetching from the branches (respectively)
+`pu` and `maint` from the remote repository.
 +
-The `pu` branch will be updated even if it is does not
-fast-forward; the others will not be.
+The `pu` branch will be updated even if it is does not fast-forward;
+the others will not be.
 +
 The final command then merges the newly fetched `tmp` into master.
 
@@ -181,4 +203,4 @@ Junio C Hamano and the git-list <git@vger.kernel.org>.
 
 GIT
 ---
-Part of the linkgit:git[7] suite
+Part of the linkgit:git[1] suite