github.com/x-oss-byte/git-lfs@v2.5.2+incompatible/docs/man/git-lfs-fetch.1.ronn (about) 1 git-lfs-fetch(1) -- Download all Git LFS files for a given ref 2 ============================================================== 3 4 ## SYNOPSIS 5 6 `git lfs fetch` [options] [<remote> [<ref>...]] 7 8 ## DESCRIPTION 9 10 Download Git LFS objects at the given refs from the specified remote. See 11 [DEFAULT REMOTE] and [DEFAULT REFS] for what happens if you don't specify. 12 13 This does not update the working copy. 14 15 ## OPTIONS 16 17 * `-I` <paths> `--include=`<paths>: 18 Specify lfs.fetchinclude just for this invocation; see [INCLUDE AND EXCLUDE] 19 20 * `-X` <paths> `--exclude=`<paths>: 21 Specify lfs.fetchexclude just for this invocation; see [INCLUDE AND EXCLUDE] 22 23 * `--recent`: 24 Download objects referenced by recent branches & commits in addition to those 25 that would otherwise be downloaded. See [RECENT CHANGES] 26 27 * `--all`: 28 Download all objects referenced by any commit that is reachable; this is 29 primarily for backup / migration purposes. Cannot be combined with --recent or 30 --include/--exclude. Ignores any globally configured include and exclude paths 31 to ensure that all objects are downloaded. 32 33 * `--prune` `-p`: 34 Prune old and unreferenced objects after fetching, equivalent to running 35 `git lfs prune` afterwards. See git-lfs-prune(1) for more details. 36 37 ## INCLUDE AND EXCLUDE 38 39 You can configure Git LFS to only fetch objects to satisfy references in certain 40 paths of the repo, and/or to exclude certain paths of the repo, to reduce the 41 time you spend downloading things you do not use. 42 43 In gitconfig, set lfs.fetchinclude and lfs.fetchexclude to comma-separated lists 44 of paths to include/exclude in the fetch (pattern matching as per golang's 45 `filepath.Match()`). Only paths which are matched by fetchinclude and not 46 matched by fetchexclude will have objects fetched for them. 47 48 ### Examples: 49 50 * `git config lfs.fetchinclude "textures,images/foo*"` 51 52 This will only fetch objects referenced in paths in the textures folder, and 53 files called foo* in the images folder 54 55 * `git config lfs.fetchinclude "*.jpg,*.png,*.tga"` 56 57 Only fetch JPG/PNG/TGA files, wherever they are in the repository 58 59 * `git config lfs.fetchexclude "media/reallybigfiles"` 60 61 Don't fetch any LFS objects referenced in the folder media/reallybigfiles, but 62 fetch everything else 63 64 * `git config lfs.fetchinclude "media"`<br> 65 `git config lfs.fetchexclude "media/excessive"` 66 67 Only fetch LFS objects in the 'media' folder, but exclude those in one of its 68 subfolders. 69 70 ## DEFAULT REMOTE 71 72 Without arguments, fetch downloads from the default remote. The default remote 73 is the same as for `git fetch`, i.e. based on the remote branch you're tracking 74 first, or origin otherwise. 75 76 ## DEFAULT REFS 77 78 If no refs are given as arguments, the currently checked out ref is used. In 79 addition, if enabled, recently changed refs and commits are also 80 included. See [RECENT CHANGES] for details. 81 82 ## RECENT CHANGES 83 84 If the `--recent` option is specified, or if the gitconfig option 85 `lfs.fetchrecentalways` is true, then after the current ref (or those in the 86 arguments) is fetched, we also search for 'recent' changes to fetch 87 objects for, so that it's more convenient to checkout or diff those commits 88 without incurring further downloads. 89 90 What changes are considered 'recent' is based on a number of gitconfig options: 91 92 * `lfs.fetchrecentrefsdays` 93 If non-zero, includes branches which have commits within N days of the current 94 date. Only local refs are included unless lfs.fetchrecentremoterefs is true. 95 The default is 7 days. 96 97 * `lfs.fetchrecentremoterefs` 98 If true, fetches remote refs (for the remote you're fetching) as well as local 99 refs in the recent window. This is useful to fetch objects for remote branches 100 you might want to check out later. The default is true; if you set this to 101 false, fetching for those branches will only occur when you either check them 102 out (losing the advantage of fetch --recent), or create a tracking local 103 branch separately then fetch again. 104 105 * `lfs.fetchrecentcommitsdays` 106 In addition to fetching at branches, also fetches changes made within N 107 days of the latest commit on the branch. This is useful if you're often 108 reviewing recent changes. The default is 0 (no previous changes). 109 110 * `lfs.fetchrecentalways` 111 Always operate as if --recent was provided on the command line. 112 113 114 ## EXAMPLES 115 116 * Fetch the LFS objects for the current ref from default remote 117 118 `git lfs fetch` 119 120 * Fetch the LFS objects for the current ref AND recent changes from default 121 remote 122 123 `git lfs fetch --recent` 124 125 * Fetch the LFS objects for the current ref from a secondary remote 'upstream' 126 127 `git lfs fetch upstream` 128 129 * Fetch the LFS objects for a branch from origin 130 131 `git lfs fetch origin mybranch` 132 133 * Fetch the LFS objects for 2 branches and a commit from origin 134 135 `git lfs fetch origin master mybranch e445b45c1c9c6282614f201b62778e4c0688b5c8` 136 137 ## SEE ALSO 138 139 git-lfs-checkout(1), git-lfs-pull(1), git-lfs-prune(1). 140 141 Part of the git-lfs(1) suite.