<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<article lang="en" id="git-pull(1)">
<articleinfo>
    <title>git-pull(1)</title>
        <indexterm>
                <primary>git-pull(1)</primary>
        </indexterm>
</articleinfo>
<simplesect id="_name">
<title>NAME</title>
<simpara>git-pull - Fetch from and merge with another repository or a local branch</simpara>
</simplesect>
<simplesect id="_synopsis">
<title>SYNOPSIS</title>
<simpara><emphasis>git pull</emphasis> &lt;options&gt; &lt;repository&gt; &lt;refspec&gt;&#8230;</simpara>
</simplesect>
<simplesect id="_description">
<title>DESCRIPTION</title>
<simpara>Runs <emphasis>git-fetch</emphasis> with the given parameters, and calls <emphasis>git-merge</emphasis>
to merge the retrieved head(s) into the current branch.
With <literal>--rebase</literal>, calls <emphasis>git-rebase</emphasis> instead of <emphasis>git-merge</emphasis>.</simpara>
<simpara>Note that you can use <literal>.</literal> (current directory) as the
&lt;repository&gt; to pull from the local repository&#8201;&#8212;&#8201;this is useful
when merging local branches into the current branch.</simpara>
<simpara>Also note that options meant for <emphasis>git-pull</emphasis> itself and underlying
<emphasis>git-merge</emphasis> must be given before the options meant for <emphasis>git-fetch</emphasis>.</simpara>
</simplesect>
<simplesect id="_options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
-q
</term>
<term>
--quiet
</term>
<listitem>
<simpara>
        Operate quietly.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-v
</term>
<term>
--verbose
</term>
<listitem>
<simpara>
        Be verbose.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--stat
</term>
<listitem>
<simpara>
        Show a diffstat at the end of the merge. The diffstat is also
        controlled by the configuration option merge.stat.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-n
</term>
<term>
--no-stat
</term>
<listitem>
<simpara>
        Do not show a diffstat at the end of the merge.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--summary
</term>
<term>
--no-summary
</term>
<listitem>
<simpara>
        Synonyms to --stat and --no-stat; these are deprecated and will be
        removed in the future.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--log
</term>
<listitem>
<simpara>
        In addition to branch names, populate the log message with
        one-line descriptions from the actual commits that are being
        merged.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-log
</term>
<listitem>
<simpara>
        Do not list one-line descriptions from the actual commits being
        merged.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-commit
</term>
<listitem>
<simpara>
        Perform the merge but pretend the merge failed and do
        not autocommit, to give the user a chance to inspect and
        further tweak the merge result before committing.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--commit
</term>
<listitem>
<simpara>
        Perform the merge and commit the result. This option can
        be used to override --no-commit.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--squash
</term>
<listitem>
<simpara>
        Produce the working tree and index state as if a real
        merge happened, but do not actually make a commit or
        move the <literal>HEAD</literal>, nor record <literal>$GIT_DIR/MERGE_HEAD</literal> to
        cause the next <literal>git commit</literal> command to create a merge
        commit.  This allows you to create a single commit on
        top of the current branch whose effect is the same as
        merging another branch (or more in case of an octopus).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-squash
</term>
<listitem>
<simpara>
        Perform the merge and commit the result. This option can
        be used to override --squash.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-ff
</term>
<listitem>
<simpara>
        Generate a merge commit even if the merge resolved as a
        fast-forward.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ff
</term>
<listitem>
<simpara>
        Do not generate a merge commit if the merge resolved as
        a fast-forward, only update the branch pointer. This is
        the default behavior of git-merge.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-s &lt;strategy&gt;
</term>
<term>
--strategy=&lt;strategy&gt;
</term>
<listitem>
<simpara>
        Use the given merge strategy; can be supplied more than
        once to specify them in the order they should be tried.
        If there is no <literal>-s</literal> option, a built-in list of strategies
        is used instead (<emphasis>git-merge-recursive</emphasis> when merging a single
        head, <emphasis>git-merge-octopus</emphasis> otherwise).
</simpara>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term>
--rebase
</term>
<listitem>
<simpara>
        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 make this the default
        for branch <literal>&lt;name&gt;</literal>, set configuration <literal>branch.&lt;name&gt;.rebase</literal>
        to <literal>true</literal>.
</simpara>
<note><simpara>This is a potentially <emphasis>dangerous</emphasis> mode of operation.
It rewrites history, which does not bode well when you
published that history already.  Do <emphasis role="strong">not</emphasis> use this option
unless you have read <xref linkend="git-rebase(1)"/> carefully.</simpara></note>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-rebase
</term>
<listitem>
<simpara>
        Override earlier --rebase.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-q
</term>
<term>
--quiet
</term>
<listitem>
<simpara>
        Pass --quiet to git-fetch-pack and silence any other internally
        used programs.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-v
</term>
<term>
--verbose
</term>
<listitem>
<simpara>
        Be verbose.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-a
</term>
<term>
--append
</term>
<listitem>
<simpara>
        Append ref names and object names of fetched refs to the
        existing contents of <literal>.git/FETCH_HEAD</literal>.  Without this
        option old data in <literal>.git/FETCH_HEAD</literal> will be overwritten.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--upload-pack &lt;upload-pack&gt;
</term>
<listitem>
<simpara>
        When given, and the repository to fetch from is handled
        by <emphasis>git-fetch-pack</emphasis>, <emphasis>--exec=&lt;upload-pack&gt;</emphasis> is passed to
        the command to specify non-default path for the command
        run on the other end.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-f
</term>
<term>
--force
</term>
<listitem>
<simpara>
        When <emphasis>git-fetch</emphasis> is used with <literal>&lt;rbranch&gt;:&lt;lbranch&gt;</literal>
        refspec, it refuses to update the local branch
        <literal>&lt;lbranch&gt;</literal> unless the remote branch <literal>&lt;rbranch&gt;</literal> it
        fetches is a descendant of <literal>&lt;lbranch&gt;</literal>.  This option
        overrides that check.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-tags
</term>
<listitem>
<simpara>
        By default, tags that point at objects that are downloaded
        from the remote repository are fetched and stored locally.
        This option disables this automatic tag following.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-t
</term>
<term>
--tags
</term>
<listitem>
<simpara>
        Most of the tags are fetched automatically as branch
        heads are downloaded, but tags that do not point at
        objects reachable from the branch heads that are being
        tracked will not be fetched by this mechanism.  This
        flag lets all tags and their associated objects be
        downloaded.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-k
</term>
<term>
--keep
</term>
<listitem>
<simpara>
        Keep downloaded pack.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-u
</term>
<term>
--update-head-ok
</term>
<listitem>
<simpara>
        By default <emphasis>git-fetch</emphasis> refuses to update the head which
        corresponds to the current branch.  This flag disables the
        check.  This is purely for the internal use for <emphasis>git-pull</emphasis>
        to communicate with <emphasis>git-fetch</emphasis>, and unless you are
        implementing your own Porcelain you are not supposed to
        use it.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--depth=&lt;depth&gt;
</term>
<listitem>
<simpara>
        Deepen the history of a <emphasis>shallow</emphasis> repository created by
        <literal>git clone</literal> with <literal>--depth=&lt;depth&gt;</literal> option (see <xref linkend="git-clone(1)"/>)
        by the specified number of commits.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
&lt;repository&gt;
</term>
<listitem>
<simpara>
        The "remote" repository that is the source of a fetch
        or pull operation.  This parameter can be either a URL
        (see the section <link linkend="URLS">GIT URLS</link> below) or the name
        of a remote (see the section <link linkend="REMOTES">REMOTES</link> below).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
&lt;refspec&gt;
</term>
<listitem>
<simpara>
        The format of a &lt;refspec&gt; parameter is an optional plus
        <literal>&#43;</literal>, followed by the source ref &lt;src&gt;, followed
        by a colon <literal>:</literal>, followed by the destination ref &lt;dst&gt;.
</simpara>
<simpara>The remote ref that matches &lt;src&gt;
is fetched, and if &lt;dst&gt; is not empty string, the local
ref that matches it is fast forwarded using &lt;src&gt;.
If the optional plus <literal>+</literal> is used, the local ref
is updated even if it does not result in a fast forward
update.</simpara>
<note><simpara>If the remote branch from which you want to pull is
modified in non-linear ways such as being rewound and
rebased frequently, then a pull will attempt a merge with
an older version of itself, likely conflict, and fail.
It is under these conditions that you would want to use
the <literal>+</literal> sign to indicate non-fast-forward updates will
be needed.  There is currently no easy way to determine
or declare that a branch will be made available in a
repository with this behavior; the pulling user simply
must know this is the expected usage pattern for a branch.</simpara></note>
<note><simpara>You never do your own development on branches that appear
on the right hand side of a &lt;refspec&gt; colon on <literal>Pull:</literal> lines;
they are to be updated by <emphasis>git-fetch</emphasis>.  If you intend to do
development derived from a remote branch <literal>B</literal>, have a <literal>Pull:</literal>
line to track it (i.e. <literal>Pull: B:remote-B</literal>), and have a separate
branch <literal>my-B</literal> to do your development on top of it.  The latter
is created by <literal>git branch my-B remote-B</literal> (or its equivalent <literal>git
checkout -b my-B remote-B</literal>).  Run <literal>git fetch</literal> to keep track of
the progress of the remote side, and when you see something new
on the remote branch, merge it into your development branch with
<literal>git pull . remote-B</literal>, while you are on <literal>my-B</literal> branch.</simpara></note>
<note><simpara>There is a difference between listing multiple &lt;refspec&gt;
directly on <emphasis>git-pull</emphasis> command line and having multiple
<literal>Pull:</literal> &lt;refspec&gt; lines for a &lt;repository&gt; and running
<emphasis>git-pull</emphasis> command without any explicit &lt;refspec&gt; parameters.
&lt;refspec&gt; listed explicitly on the command line are always
merged into the current branch after fetching.  In other words,
if you list more than one remote refs, you would be making
an Octopus.  While <emphasis>git-pull</emphasis> run without any explicit &lt;refspec&gt;
parameter takes default &lt;refspec&gt;s from <literal>Pull:</literal> lines, it
merges only the first &lt;refspec&gt; found into the current branch,
after fetching all the remote refs.  This is because making an
Octopus from remote refs is rarely done, while keeping track
of multiple remote heads in one-go by fetching more than one
is often useful.</simpara></note>
<simpara>Some short-cut notations are also supported.</simpara>
<itemizedlist>
<listitem>
<simpara>
<literal>tag &lt;tag&gt;</literal> means the same as <literal>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</literal>;
  it requests fetching everything up to the given tag.
</simpara>
</listitem>
<listitem>
<simpara>
A parameter &lt;ref&gt; without a colon is equivalent to
  &lt;ref&gt;: when pulling/fetching, so it merges &lt;ref&gt; into the current
  branch without storing the remote branch anywhere locally
</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="_git_urls_anchor_id_urls_xreflabel_urls">
<title>GIT URLS<anchor id="URLS" xreflabel="[URLS]"/></title>
<simpara>One of the following notations can be used
to name the remote repository:</simpara>
<informalexample>
<itemizedlist>
<listitem>
<simpara>
rsync://host.xz/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
<ulink url="http://host.xz&#91;:port&#93;/path/to/repo.git/">http://host.xz&#91;:port&#93;/path/to/repo.git/</ulink>
</simpara>
</listitem>
<listitem>
<simpara>
<ulink url="https://host.xz&#91;:port&#93;/path/to/repo.git/">https://host.xz&#91;:port&#93;/path/to/repo.git/</ulink>
</simpara>
</listitem>
<listitem>
<simpara>
git://host.xz&#91;:port&#93;/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
git://host.xz&#91;:port&#93;/~user/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
ssh://&#91;user@&#93;host.xz/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
ssh://&#91;user@&#93;host.xz/~user/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
ssh://&#91;user@&#93;host.xz/~/path/to/repo.git
</simpara>
</listitem>
</itemizedlist>
</informalexample>
<simpara>SSH is the default transport protocol over the network.  You can
optionally specify which user to log-in as, and an alternate,
scp-like syntax is also supported.  Both syntaxes support
username expansion, as does the native git protocol, but
only the former supports port specification. The following
three are identical to the last three above, respectively:</simpara>
<informalexample>
<itemizedlist>
<listitem>
<simpara>
&#91;user@&#93;host.xz:/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
&#91;user@&#93;host.xz:~user/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
&#91;user@&#93;host.xz:path/to/repo.git
</simpara>
</listitem>
</itemizedlist>
</informalexample>
<simpara>To sync with a local directory, you can use:</simpara>
<informalexample>
<itemizedlist>
<listitem>
<simpara>
/path/to/repo.git/
</simpara>
</listitem>
<listitem>
<simpara>
<ulink url="file:///path/to/repo.git/">file:///path/to/repo.git/</ulink>
</simpara>
</listitem>
</itemizedlist>
</informalexample>
<simpara>They are mostly equivalent, except when cloning.  See
<xref linkend="git-clone(1)"/> for details.</simpara>
<simpara>If there are a large number of similarly-named remote repositories and
you want to use a different format for them (such that the URLs you
use will be rewritten into URLs that work), you can create a
configuration section of the form:</simpara>
<literallayout>        [url "&lt;actual url base&gt;"]
                insteadOf = &lt;other url base&gt;</literallayout>
<simpara>For example, with this:</simpara>
<literallayout>        [url "git://git.host.xz/"]
                insteadOf = host.xz:/path/to/
                insteadOf = work:</literallayout>
<simpara>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</simpara>
</simplesect>
<simplesect id="_remotes_anchor_id_remotes_xreflabel_remotes">
<title>REMOTES<anchor id="REMOTES" xreflabel="[REMOTES]"/></title>
<simpara>The name of one of the following can be used instead
of a URL as <literal>&lt;repository&gt;</literal> argument:</simpara>
<itemizedlist>
<listitem>
<simpara>
a remote in the git configuration file: <literal>$GIT_DIR/config</literal>,
</simpara>
</listitem>
<listitem>
<simpara>
a file in the <literal>$GIT_DIR/remotes</literal> directory, or
</simpara>
</listitem>
<listitem>
<simpara>
a file in the <literal>$GIT_DIR/branches</literal> directory.
</simpara>
</listitem>
</itemizedlist>
<simpara>All of these also allow you to omit the refspec from the command line
because they each contain a refspec which git will use by default.</simpara>
<simplesect id="_named_remote_in_configuration_file">
<title>Named remote in configuration file</title>
<simpara>You can choose to provide the name of a remote which you had previously
configured using <xref linkend="git-remote(1)"/>, <xref linkend="git-config(1)"/>
or even by a manual edit to the <literal>$GIT_DIR/config</literal> file.  The URL of
this remote will be used to access the repository.  The refspec
of this remote will be used by default when you do
not provide a refspec on the command line.  The entry in the
config file would appear like this:</simpara>
<literallayout>        [remote "&lt;name&gt;"]
                url = &lt;url&gt;
                push = &lt;refspec&gt;
                fetch = &lt;refspec&gt;</literallayout>
</simplesect>
<simplesect id="_named_file_in_literal_git_dir_remotes_literal">
<title>Named file in <literal>$GIT_DIR/remotes</literal></title>
<simpara>You can choose to provide the name of a
file in <literal>$GIT_DIR/remotes</literal>.  The URL
in this file will be used to access the repository.  The refspec
in this file will be used as default when you do not
provide a refspec on the command line.  This file should have the
following format:</simpara>
<literallayout>        URL: one of the above URL format
        Push: &lt;refspec&gt;
        Pull: &lt;refspec&gt;</literallayout>
<simpara><literal>Push:</literal> lines are used by <emphasis>git-push</emphasis> and
<literal>Pull:</literal> lines are used by <emphasis>git-pull</emphasis> and <emphasis>git-fetch</emphasis>.
Multiple <literal>Push:</literal> and <literal>Pull:</literal> lines may
be specified for additional branch mappings.</simpara>
</simplesect>
<simplesect id="_named_file_in_literal_git_dir_branches_literal">
<title>Named file in <literal>$GIT_DIR/branches</literal></title>
<simpara>You can choose to provide the name of a
file in <literal>$GIT_DIR/branches</literal>.
The URL in this file will be used to access the repository.
This file should have the following format:</simpara>
<literallayout>        &lt;url&gt;#&lt;head&gt;</literallayout>
<simpara><literal>&lt;url&gt;</literal> is required; <literal>#&lt;head&gt;</literal> is optional.</simpara>
<simpara>Depending on the operation, git will use one of the following
refspecs, if you don&#8217;t provide one on the command line.
<literal>&lt;branch&gt;</literal> is the name of this file in <literal>$GIT_DIR/branches</literal> and
<literal>&lt;head&gt;</literal> defaults to <literal>master</literal>.</simpara>
<simpara>git fetch uses:</simpara>
<literallayout>        refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</literallayout>
<simpara>git push uses:</simpara>
<literallayout>        HEAD:refs/heads/&lt;head&gt;</literallayout>
</simplesect>
</simplesect>
<simplesect id="_merge_strategies">
<title>MERGE STRATEGIES</title>
<variablelist>
<varlistentry>
<term>
resolve
</term>
<listitem>
<simpara>
        This can only resolve two heads (i.e. the current branch
        and another branch you pulled from) using 3-way merge
        algorithm.  It tries to carefully detect criss-cross
        merge ambiguities and is considered generally safe and
        fast.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
recursive
</term>
<listitem>
<simpara>
        This can only resolve two heads using 3-way merge
        algorithm.  When there are more than one common
        ancestors that can be used for 3-way merge, it creates a
        merged tree of the common ancestors and uses that as
        the reference tree for the 3-way merge.  This has been
        reported to result in fewer merge conflicts without
        causing mis-merges by tests done on actual merge commits
        taken from Linux 2.6 kernel development history.
        Additionally this can detect and handle merges involving
        renames.  This is the default merge strategy when
        pulling or merging one branch.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
octopus
</term>
<listitem>
<simpara>
        This resolves more than two-head case, but refuses to do
        complex merge that needs manual resolution.  It is
        primarily meant to be used for bundling topic branch
        heads together.  This is the default merge strategy when
        pulling or merging more than one branches.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
ours
</term>
<listitem>
<simpara>
        This resolves any number of heads, but the result of the
        merge is always the current branch head.  It is meant to
        be used to supersede old development history of side
        branches.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
subtree
</term>
<listitem>
<simpara>
        This is a modified recursive strategy. When merging trees A and
        B, if B corresponds to a subtree of A, B is first adjusted to
        match the tree structure of A, instead of reading the trees at
        the same level. This adjustment is also done to the common
        ancestor tree.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="_default_behaviour">
<title>DEFAULT BEHAVIOUR</title>
<simpara>Often people use <literal>git pull</literal> without giving any parameter.
Traditionally, this has been equivalent to saying <literal>git pull
origin</literal>.  However, when configuration <literal>branch.&lt;name&gt;.remote</literal> is
present while on branch <literal>&lt;name&gt;</literal>, that value is used instead of
<literal>origin</literal>.</simpara>
<simpara>In order to determine what URL to use to fetch from, the value
of the configuration <literal>remote.&lt;origin&gt;.url</literal> is consulted
and if there is not any such variable, the value on <literal>URL: ` line
in `$GIT_DIR/remotes/&lt;origin&gt;</literal> file is used.</simpara>
<simpara>In order to determine what remote branches to fetch (and
optionally store in the tracking branches) when the command is
run without any refspec parameters on the command line, values
of the configuration variable <literal>remote.&lt;origin&gt;.fetch</literal> are
consulted, and if there aren&#8217;t any, <literal>$GIT_DIR/remotes/&lt;origin&gt;</literal>
file is consulted and its `Pull: ` lines are used.
In addition to the refspec formats described in the OPTIONS
section, you can have a globbing refspec that looks like this:</simpara>
<literallayout>refs/heads/*:refs/remotes/origin/*</literallayout>
<simpara>A globbing refspec must have a non-empty RHS (i.e. must store
what were fetched in tracking branches), and its LHS and RHS
must end with <literal>/*</literal>.  The above specifies that all remote
branches are tracked using tracking branches in
<literal>refs/remotes/origin/</literal> hierarchy under the same name.</simpara>
<simpara>The rule to determine which remote branch to merge after
fetching is a bit involved, in order not to break backward
compatibility.</simpara>
<simpara>If explicit refspecs were given on the command
line of <literal>git pull</literal>, they are all merged.</simpara>
<simpara>When no refspec was given on the command line, then <literal>git pull</literal>
uses the refspec from the configuration or
<literal>$GIT_DIR/remotes/&lt;origin&gt;</literal>.  In such cases, the following
rules apply:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>
If <literal>branch.&lt;name&gt;.merge</literal> configuration for the current
  branch <literal>&lt;name&gt;</literal> exists, that is the name of the branch at the
  remote site that is merged.
</simpara>
</listitem>
<listitem>
<simpara>
If the refspec is a globbing one, nothing is merged.
</simpara>
</listitem>
<listitem>
<simpara>
Otherwise the remote branch of the first refspec is merged.
</simpara>
</listitem>
</orderedlist>
</simplesect>
<simplesect id="_examples">
<title>EXAMPLES</title>
<itemizedlist>
<listitem>
<simpara>
Update the remote-tracking branches for the repository
  you cloned from, then merge one of them into your
  current branch:
</simpara>
<literallayout>$ git pull, git pull origin</literallayout>
<simpara>Normally the branch merged in is the HEAD of the remote repository,
but the choice is determined by the branch.&lt;name&gt;.remote and
branch.&lt;name&gt;.merge options; see <xref linkend="git-config(1)"/> for details.</simpara>
</listitem>
<listitem>
<simpara>
Merge into the current branch the remote branch <literal>next</literal>:
</simpara>
<literallayout>$ git pull origin next</literallayout>
<simpara>This leaves a copy of <literal>next</literal> temporarily in FETCH_HEAD, but
does not update any remote-tracking branches.</simpara>
</listitem>
<listitem>
<simpara>
Bundle local branch <literal>fixes</literal> and <literal>enhancements</literal> on top of
  the current branch, making an Octopus merge:
</simpara>
<literallayout>$ git pull . fixes enhancements</literallayout>
<simpara>This <literal>git pull .</literal> syntax is equivalent to <literal>git merge</literal>.</simpara>
</listitem>
<listitem>
<simpara>
Merge local branch <literal>obsolete</literal> into the current branch, using <literal>ours</literal>
  merge strategy:
</simpara>
<literallayout>$ git pull -s ours . obsolete</literallayout>
</listitem>
<listitem>
<simpara>
Merge local branch <literal>maint</literal> into the current branch, but do not make
  a commit automatically:
</simpara>
<literallayout>$ git pull --no-commit . maint</literallayout>
<simpara>This can be used when you want to include further changes to the
merge, or want to write your own merge commit message.</simpara>
<simpara>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.</simpara>
</listitem>
<listitem>
<simpara>
Command line pull of multiple branches from one repository:
</simpara>
<literallayout>$ git checkout master
$ git fetch origin +pu:pu maint:tmp
$ git pull . tmp</literallayout>
<simpara>This updates (or creates, as necessary) branches <literal>pu</literal> and <literal>tmp</literal> in
the local repository by fetching from the branches (respectively)
<literal>pu</literal> and <literal>maint</literal> from the remote repository.</simpara>
<simpara>The <literal>pu</literal> branch will be updated even if it is does not fast-forward;
the others will not be.</simpara>
<simpara>The final command then merges the newly fetched <literal>tmp</literal> into master.</simpara>
</listitem>
</itemizedlist>
<simpara>If you tried a pull which resulted in a complex conflicts and
would want to start over, you can recover with <emphasis>git-reset</emphasis>.</simpara>
</simplesect>
<simplesect id="_see_also">
<title>SEE ALSO</title>
<simpara><xref linkend="git-fetch(1)"/>, <xref linkend="git-merge(1)"/>, <xref linkend="git-config(1)"/></simpara>
</simplesect>
<simplesect id="_author">
<title>Author</title>
<simpara>Written by Linus Torvalds &lt;<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>&gt;
and Junio C Hamano &lt;<ulink url="mailto:gitster@pobox.com">gitster@pobox.com</ulink>&gt;</simpara>
</simplesect>
<simplesect id="_documentation">
<title>Documentation</title>
<simpara>Documentation by Jon Loeliger,
David Greaves,
Junio C Hamano and the git-list &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;.</simpara>
</simplesect>
<simplesect id="_git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
</simplesect>
</article>
