2015-05-29 15:28:10 +00:00
|
|
|
git-lfs-fetch(1) -- Download all Git LFS files for a given ref
|
|
|
|
==============================================================
|
|
|
|
|
|
|
|
## SYNOPSIS
|
|
|
|
|
2015-08-13 16:22:29 +00:00
|
|
|
`git lfs fetch` [options] [<remote> [<ref>...]]
|
2015-05-29 15:28:10 +00:00
|
|
|
|
|
|
|
## DESCRIPTION
|
|
|
|
|
2015-08-17 11:05:29 +00:00
|
|
|
Download Git LFS objects at the given refs from the specified remote. See
|
|
|
|
[DEFAULT REMOTE] and [DEFAULT REFS] for what happens if you don't specify.
|
2015-05-29 15:28:10 +00:00
|
|
|
|
2015-07-23 16:53:58 +00:00
|
|
|
This does not update the working copy.
|
2015-05-29 15:28:10 +00:00
|
|
|
|
2015-08-07 17:18:39 +00:00
|
|
|
## OPTIONS
|
|
|
|
|
|
|
|
* `-I` <paths> `--include=`<paths>:
|
2015-08-17 11:05:29 +00:00
|
|
|
Specify lfs.fetchinclude just for this invocation; see [INCLUDE AND EXCLUDE]
|
2015-08-07 17:18:39 +00:00
|
|
|
|
|
|
|
* `-X` <paths> `--exclude=`<paths>:
|
2015-08-17 11:05:29 +00:00
|
|
|
Specify lfs.fetchexclude just for this invocation; see [INCLUDE AND EXCLUDE]
|
2015-08-07 17:18:39 +00:00
|
|
|
|
2015-08-17 11:05:29 +00:00
|
|
|
* `--recent`:
|
2015-08-19 16:22:44 +00:00
|
|
|
Download objects referenced by recent branches & commits in addition to those
|
2015-08-17 11:05:29 +00:00
|
|
|
that would otherwise be downloaded. See [RECENT CHANGES]
|
|
|
|
|
|
|
|
## INCLUDE AND EXCLUDE
|
2015-08-06 13:56:57 +00:00
|
|
|
|
|
|
|
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 gitconfig, set lfs.fetchinclude and lfs.fetchexclude to comma-separated lists
|
|
|
|
of paths to include/exclude in the fetch (wildcard matching as per gitignore).
|
|
|
|
Only paths which are matched by fetchinclude and not matched by fetchexclude
|
|
|
|
will have objects fetched for them.
|
|
|
|
|
2015-08-18 09:00:40 +00:00
|
|
|
### Examples:
|
|
|
|
|
|
|
|
* `git config lfs.fetchinclude="textures,images/foo*"`
|
|
|
|
|
|
|
|
This will only fetch objects referenced in paths in the textures folder, and
|
|
|
|
files called foo* in the images folder
|
|
|
|
|
|
|
|
* `git config lfs.fetchinclude="*.jpg,*.png,*.tga"`
|
|
|
|
|
|
|
|
Only fetch JPG/PNG/TGA files, wherever they are in the repository
|
|
|
|
|
|
|
|
* `git config lfs.fetchexclude="media/reallybigfiles"`
|
|
|
|
|
|
|
|
Don't fetch any LFS objects referenced in the folder media/reallybigfiles, but
|
|
|
|
fetch everything else
|
|
|
|
|
|
|
|
* `git config lfs.fetchinclude="media"`<br/>
|
|
|
|
`git config lfs.fetchexclude="media/excessive"`
|
|
|
|
|
|
|
|
Only fetch LFS objects in the 'media' folder, but exclude those in one of its
|
|
|
|
subfolders.
|
|
|
|
|
2015-08-17 11:05:29 +00:00
|
|
|
## DEFAULT REMOTE
|
|
|
|
|
|
|
|
Without arguments, fetch downloads from the default remote. The default remote
|
|
|
|
is the same as for `git fetch`, i.e. based on the remote branch you're tracking
|
|
|
|
first, or origin otherwise.
|
|
|
|
|
|
|
|
## DEFAULT REFS
|
|
|
|
|
|
|
|
If no refs are given as arguments, the currently checked out ref is used. In
|
|
|
|
addition, if enabled, recently changed refs and commits are also
|
|
|
|
included. See [RECENT CHANGES] for details.
|
|
|
|
|
|
|
|
## RECENT CHANGES
|
|
|
|
|
|
|
|
If the `--recent` option is specified, or if the gitconfig option
|
|
|
|
`lfs.fetchrecentalways` is true, then after the current ref (or those in the
|
|
|
|
arguments) is fetched, we also search for 'recent' changes to fetch
|
|
|
|
objects for, so that it's more convenient to checkout or diff those commits
|
|
|
|
without incurring further downloads.
|
2015-08-13 16:22:29 +00:00
|
|
|
|
2015-08-17 11:05:29 +00:00
|
|
|
What changes are considered 'recent' is based on a number of gitconfig options:
|
|
|
|
|
|
|
|
* `lfs.fetchrecentrefsdays`
|
2015-08-19 16:22:44 +00:00
|
|
|
If non-zero, includes branches which have commits within N days of the current
|
2015-08-17 11:05:29 +00:00
|
|
|
date. Only local refs are included unless lfs.fetchrecentremoterefs is true.
|
|
|
|
The default is 7 days.
|
|
|
|
|
|
|
|
* `lfs.fetchrecentremoterefs`
|
2015-09-01 11:06:30 +00:00
|
|
|
If true, fetches remote refs (for the remote you're fetching) as well as local
|
|
|
|
refs in the recent window. This is useful to fetch objects for remote branches
|
|
|
|
you might want to check out later. The default is true; if you set this to
|
|
|
|
false, fetching for those branches will only occur when you either check them
|
|
|
|
out (losing the advantage of fetch --recent), or create a tracking local
|
|
|
|
branch separately then fetch again.
|
2015-08-17 11:05:29 +00:00
|
|
|
|
|
|
|
* `lfs.fetchrecentcommitsdays`
|
2015-08-19 16:22:44 +00:00
|
|
|
In addition to fetching at branches, also fetches changes made within N
|
|
|
|
days of the latest commit on the branch. This is useful if you're often
|
|
|
|
reviewing recent changes. The default is 0 (no previous changes).
|
2015-08-17 11:05:29 +00:00
|
|
|
|
|
|
|
* `lfs.fetchrecentalways`
|
|
|
|
Always operate as if --recent was provided on the command line.
|
|
|
|
|
2015-08-13 16:22:29 +00:00
|
|
|
|
2015-05-29 15:28:10 +00:00
|
|
|
## EXAMPLES
|
|
|
|
|
2015-08-13 16:22:29 +00:00
|
|
|
* Fetch the LFS objects for the current ref from default remote
|
2015-05-29 15:28:10 +00:00
|
|
|
|
|
|
|
`git lfs fetch`
|
|
|
|
|
2015-08-17 11:05:29 +00:00
|
|
|
* Fetch the LFS objects for the current ref AND recent changes from default
|
|
|
|
remote
|
|
|
|
|
|
|
|
`git lfs fetch --recent`
|
|
|
|
|
2015-08-13 16:22:29 +00:00
|
|
|
* Fetch the LFS objects for the current ref from a secondary remote 'upstream'
|
|
|
|
|
|
|
|
`git lfs fetch upstream`
|
|
|
|
|
|
|
|
* Fetch the LFS objects for a branch from origin
|
2015-05-29 15:28:10 +00:00
|
|
|
|
2015-08-13 16:22:29 +00:00
|
|
|
`git lfs fetch origin mybranch`
|
2015-05-29 15:28:10 +00:00
|
|
|
|
2015-08-13 16:22:29 +00:00
|
|
|
* Fetch the LFS objects for 2 branches and a commit from origin
|
2015-05-29 15:28:10 +00:00
|
|
|
|
2015-08-13 16:22:29 +00:00
|
|
|
`git lfs fetch origin master mybranch e445b45c1c9c6282614f201b62778e4c0688b5c8`
|
2015-05-29 15:28:10 +00:00
|
|
|
|
2015-07-23 16:53:58 +00:00
|
|
|
## SEE ALSO
|
|
|
|
|
|
|
|
git-lfs-checkout(1), git-lfs-pull(1).
|
|
|
|
|
2015-05-29 15:28:10 +00:00
|
|
|
Part of the git-lfs(1) suite.
|
|
|
|
|