= git-lfs-pull(1)

== NAME

git-lfs-pull - Download all Git LFS files for current ref & checkout

== SYNOPSIS

`git lfs pull` [options] [<remote>]

== DESCRIPTION

Download Git LFS objects for the currently checked out ref, and update
the working copy with the downloaded content if required.

This is generally equivalent to running the following two commands:

....
$ git lfs fetch [options] [<remote>]
$ git lfs checkout
....

If the installed Git version is at least 2.42.0, in a non-bare repository
this command will by default fetch and check out Git LFS objects for files
only if they are present in the Git index and if they match a Git LFS
filter attribute from a `.gitattributes` file that is present in either
the index or the current working tree (or, as is always the case, if
they match a Git LFS filter attribute in a local `gitattributes` file
such as `$GIT_DIR/info/attributes`). These constraints do not apply
with prior versions of Git.

In a repository with a partial clone or sparse checkout, it is therefore
advisable to check out all `.gitattributes` files from `HEAD` before
using this command, if Git v2.42.0 or later is installed. Alternatively,
the `GIT_ATTR_SOURCE` environment variable may be set to `HEAD`, which
will cause Git to only read attributes from `.gitattributes` files in
`HEAD` and ignore those in the index or working tree.

In a bare repository, if the installed Git version is at least 2.42.0,
this command will by default fetch Git LFS objects for files only if
they are present in the Git index and if they match a Git LFS filter
attribute from a local `gitattributes` file such as
`$GIT_DIR/info/attributes`. Any `.gitattributes` files in `HEAD` will
be ignored, unless the `GIT_ATTR_SOURCE` environment variable is set
to `HEAD`, and any `.gitattributes` files in the index or current
working tree will always be ignored. These constraints do not apply
with prior versions of Git.

== OPTIONS

`-I <paths>`::
`--include=<paths>`::
   Specify lfs.fetchinclude just for this invocation; see <<_include_and_exclude>>
`-X <paths>`::
`--exclude=<paths>`::
   Specify lfs.fetchexclude just for this invocation; see <<_include_and_exclude>>

== INCLUDE AND EXCLUDE

You can configure Git LFS to only fetch objects to satisfy references in
certain paths of the repo, and/or to exclude certain paths of the repo,
to reduce the time you spend downloading things you do not use.

In your Git configuration or in a `.lfsconfig` file, you may set either
or both of `lfs.fetchinclude` and `lfs.fetchexclude` to comma-separated
lists of paths. If `lfs.fetchinclude` is defined, Git LFS objects will
only be fetched if their path matches one in that list, and if
`lfs.fetchexclude` is defined, Git LFS objects will only be fetched if
their path does not match one in that list. Paths are matched using
wildcard matching as per gitignore(5).

Note that using the command-line options `-I` and `-X` override the
respective configuration settings. Setting either option to an empty
string clears the value.

== DEFAULT REMOTE

Without arguments, pull downloads from the default remote. The default
remote is the same as for `git pull`, i.e. based on the remote branch
you're tracking first, or origin otherwise.

== SEE ALSO

git-lfs-fetch(1), git-lfs-checkout(1), gitattributes(5), gitignore(5).

Part of the git-lfs(1) suite.
