Debian Codegraph @

docs/man/git-lfs-track.adoc

raw
1 = git-lfs-track(1)
2
3 == NAME
4
5 git-lfs-track - View or add Git LFS paths to Git attributes
6
7 == SYNOPSIS
8
9 [source,role=synopsis,subs="verbatim,quotes"]
10 ----
11 *git lfs track* [_options_] [_<pattern>_...]
12 ----
13
14 == DESCRIPTION
15
16 Start tracking the given patterns(s) through Git LFS. The argument is
17 written to .gitattributes. If no paths are provided, simply list the
18 currently-tracked paths.
19
20 The https://git-scm.com/docs/gitattributes[gitattributes documentation]
21 states that patterns use the
22 https://git-scm.com/docs/gitignore[gitignore pattern rules] to match
23 paths. This means that patterns which contain asterisk (`*`), question
24 mark (`?`), and the bracket characters (`[` and `]`) are treated
25 specially; to disable this behavior and treat them literally instead,
26 use `--filename` or escape the character with a backslash.
27
28 == OPTIONS
29
30 `-v`::
31 `--verbose`::
32 If enabled, have `git lfs track` log files which it will touch. Disabled by
33 default.
34 `-d`::
35 `--dry-run`::
36 If enabled, have `git lfs track` log all actions it would normally take
37 (adding entries to .gitattributes, touching files on disk, etc) without
38 performing any mutative operations to the disk.
39 +
40 `git lfs track --dry-run [files]` also implicitly mocks the behavior of
41 passing the `--verbose`, and will log in greater detail what it is
42 doing.
43 +
44 Disabled by default.
45 `-j`::
46 `--json`::
47 Writes the currently tracked patterns as JSON to STDOUT, if the command
48 exits successfully. Intended for interoperation with external tools.
49 Can not be combined with any `<pattern>` arguments. If `--no-excluded` is
50 also provided, that option will have no effect.
51 `--filename`::
52 Treat the arguments as literal filenames, not as patterns. Any special glob
53 characters in the filename will be escaped when writing the `.gitattributes`
54 file.
55 `-l`::
56 `--lockable`::
57 Make the paths 'lockable', meaning they should be locked to edit them, and
58 will be made read-only in the working copy when not locked.
59 `--not-lockable`::
60 Remove the lockable flag from the paths so they are no longer read-only unless
61 locked.
62 `--no-excluded`::
63 Do not list patterns that are excluded in the output; only list patterns that
64 are tracked.
65 `--no-modify-attrs`::
66 Makes matched entries stat-dirty so that Git can re-index files you wish to
67 convert to LFS. Does not modify any `.gitattributes` file(s).
68
69 == EXAMPLES
70
71 * List the patterns that Git LFS is currently tracking:
72 +
73 `git lfs track`
74 * Configure Git LFS to track GIF files:
75 +
76 `git lfs track "*.gif"`
77 * Configure Git LFS to track PSD files and make them read-only unless
78 locked:
79 +
80 `git lfs track --lockable "*.psd"`
81 * Configure Git LFS to track the file named `project [1].psd`:
82 +
83 `git lfs track --filename "project [1].psd"`
84
85 == SEE ALSO
86
87 git-lfs-untrack(1), git-lfs-install(1), gitattributes(5), gitignore(5).
88
89 Part of the git-lfs(1) suite.