1GIT-LFS-CHECKOUT(1) General Commands Manual GIT-LFS-CHECKOUT(1)
2
3
4
6 git-lfs-checkout - Update working copy with file content if available
7
9 git lfs checkout [glob-pattern...]
10 git lfs checkout --to file {--base|--ours|--theirs} conflict-obj-path
11
13 Try to ensure that the working copy contains file content for Git LFS
14 objects for the current ref, if the object data is available. Does not
15 download any content; see git-lfs-fetch(1) for that.
16
17 Checkout scans the current ref for all LFS objects that would be re‐
18 quired, then where a file is either missing in the working copy, or
19 contains placeholder pointer content with the same SHA, the real file
20 content is written, provided we have it in the local store. Modified
21 files are never overwritten.
22
23 One or more glob-patterns may be provided as arguments to restrict the
24 set of files that are updated. Glob patterns are matched as per the
25 format described in gitignore(5).
26
27 When used with --to and the working tree is in a conflicted state due
28 to a merge, this option checks out one of the three stages a conflict‐
29 ing Git LFS object into a separate file (which can be outside of the
30 work tree). This can make using diff tools to inspect and resolve
31 merges easier. A single Git LFS object´s file path must be provided in
32 conflict-obj-path.
33
35 --base Check out the merge base of the specified file.
36
37 --ours Check out our side (that of the current branch) of the conflict
38 for the specified file.
39
40 --theirs
41 Check out their side (that of the other branch) of the conflict
42 for the specified file.
43
44 --to path
45 If the working tree is in a conflicted state, check out the por‐
46 tion of the conflict specified by --base, --ours, or --theirs to
47 the given path.
48
50 Checkout all files that are missing or placeholders:
51
52
53 $ git lfs checkout
54
55 Checkout a specific couple of files:
56
57
58 $ git lfs checkout path/to/file1.png path/to.file2.png
59
60 Checkout a path with a merge conflict into separate files:
61
62
63 ``` # Attempt merge with a branch that has a merge conflict $ git merge
64 conflicting-branch CONFLICT (content): Merge conflict in path/to/con‐
65 flicting/file.dat$ git lfs checkout ours.dat --ours path/to/conflict‐
66 ing/file.dat $ git lfs checkout theirs.dat --theirs path/to/conflict‐
67 ing/file.dat# then resolve conflict (e.g., by choosing one version over
68 # the other, or creating a new version)$ rm ours.dat theirs.dat $ git
69 add path/to/conflicting/file.dat $ git merge --continue ```
70
72 git-lfs-fetch(1), git-lfs-pull(1), gitignore(5).
73
74 Part of the git-lfs(1) suite.
75
76
77
78 February 2022 GIT-LFS-CHECKOUT(1)