.\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 .TH "GIT\-LFS\-FETCH" "1" "July 2021" "" .SH "NAME" \fBgit\-lfs\-fetch\fR \- Download all Git LFS files for a given ref .SH "SYNOPSIS" \fBgit lfs fetch\fR [options] [\fIremote\fR [\fIref\fR\|\.\|\.\|\.]] .SH "DESCRIPTION" Download Git LFS objects at the given refs from the specified remote\. See \fIDEFAULT REMOTE\fR and \fIDEFAULT REFS\fR for what happens if you don't specify\. .P This does not update the working copy\. .SH "OPTIONS" .TP \fB\-I\fR \fIpaths\fR \fB\-\-include=\fR\fIpaths\fR Specify lfs\.fetchinclude just for this invocation; see \fIINCLUDE AND EXCLUDE\fR .TP \fB\-X\fR \fIpaths\fR \fB\-\-exclude=\fR\fIpaths\fR Specify lfs\.fetchexclude just for this invocation; see \fIINCLUDE AND EXCLUDE\fR .TP \fB\-\-recent\fR Download objects referenced by recent branches & commits in addition to those that would otherwise be downloaded\. See \fIRECENT CHANGES\fR .TP \fB\-\-all\fR Download all objects that are referenced by any commit reachable from the refs provided as arguments\. If no refs are provided, then all refs are fetched\. This is primarily for backup and migration purposes\. Cannot be combined with \-\-recent or \-\-include/\-\-exclude\. Ignores any globally configured include and exclude paths to ensure that all objects are downloaded\. .TP \fB\-\-prune\fR \fB\-p\fR Prune old and unreferenced objects after fetching, equivalent to running \fBgit lfs prune\fR afterwards\. See git\-lfs\-prune(1) for more details\. .SH "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\. .P In gitconfig, set \fBlfs\.fetchinclude\fR and \fBlfs\.fetchexclude\fR to comma\-separated lists of paths to include/exclude in the fetch\. Only paths which are matched by \fBfetchinclude\fR and not matched by \fBfetchexclude\fR will have objects fetched for them\. .SS "Examples:" .IP "\[ci]" 4 \fBgit config lfs\.fetchinclude "textures,images/foo*"\fR .IP This will only fetch objects referenced in paths in the textures folder, and files called foo* in the images folder .IP "\[ci]" 4 \fBgit config lfs\.fetchinclude "*\.jpg,*\.png,*\.tga"\fR .IP Only fetch JPG/PNG/TGA files, wherever they are in the repository .IP "\[ci]" 4 \fBgit config lfs\.fetchexclude "media/reallybigfiles"\fR .IP Don't fetch any LFS objects referenced in the folder media/reallybigfiles, but fetch everything else .IP "\[ci]" 4 \fBgit config lfs\.fetchinclude "media"\fR .br \fBgit config lfs\.fetchexclude "media/excessive"\fR .IP Only fetch LFS objects in the 'media' folder, but exclude those in one of its subfolders\. .IP "" 0 .SH "DEFAULT REMOTE" Without arguments, fetch downloads from the default remote\. The default remote is the same as for \fBgit fetch\fR, i\.e\. based on the remote branch you're tracking first, or origin otherwise\. .SH "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 \fIRECENT CHANGES\fR for details\. .SH "RECENT CHANGES" If the \fB\-\-recent\fR option is specified, or if the gitconfig option \fBlfs\.fetchrecentalways\fR 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\. .P What changes are considered 'recent' is based on a number of gitconfig options: .IP "\[ci]" 4 \fBlfs\.fetchrecentrefsdays\fR If non\-zero, includes branches which have commits within N days of the current date\. Only local refs are included unless lfs\.fetchrecentremoterefs is true\. The default is 7 days\. .IP "\[ci]" 4 \fBlfs\.fetchrecentremoterefs\fR 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\. .IP "\[ci]" 4 \fBlfs\.fetchrecentcommitsdays\fR 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)\. .IP "\[ci]" 4 \fBlfs\.fetchrecentalways\fR Always operate as if \-\-recent was provided on the command line\. .IP "" 0 .SH "EXAMPLES" .IP "\[ci]" 4 Fetch the LFS objects for the current ref from default remote .IP \fBgit lfs fetch\fR .IP "\[ci]" 4 Fetch the LFS objects for the current ref AND recent changes from default remote .IP \fBgit lfs fetch \-\-recent\fR .IP "\[ci]" 4 Fetch the LFS objects for the current ref from a secondary remote 'upstream' .IP \fBgit lfs fetch upstream\fR .IP "\[ci]" 4 Fetch all the LFS objects from the default remote that are referenced by any commit in the \fBmaster\fR and \fBdevelop\fR branches .IP \fBgit lfs fetch \-\-all origin master develop\fR .IP "\[ci]" 4 Fetch the LFS objects for a branch from origin .IP \fBgit lfs fetch origin mybranch\fR .IP "\[ci]" 4 Fetch the LFS objects for 2 branches and a commit from origin .IP \fBgit lfs fetch origin master mybranch e445b45c1c9c6282614f201b62778e4c0688b5c8\fR .IP "" 0 .SH "SEE ALSO" git\-lfs\-checkout(1), git\-lfs\-pull(1), git\-lfs\-prune(1)\. .P Part of the git\-lfs(1) suite\.