table of contents
GIT-LS-FILES(1) | Git Manual | GIT-LS-FILES(1) |
NAME¶
git-ls-files - Show information about files in the index and the working tree
SYNOPSIS¶
git ls-files [-z] [-t] [-v]
(--[cached|deleted|others|ignored|stage|unmerged|killed|modified])\*
(-[c|d|o|i|s|u|k|m])\*
[-x <pattern>|--exclude=<pattern>]
[-X <file>|--exclude-from=<file>]
[--exclude-per-directory=<file>]
[--exclude-standard]
[--error-unmatch] [--with-tree=<tree-ish>]
[--full-name] [--abbrev] [--] [<file>]\*
DESCRIPTION¶
This merges the file listing in the directory cache index with the actual working directory list, and shows different combinations of the two.
One or more of the options below may be used to determine the files shown:
OPTIONS¶
-c, --cached
-d, --deleted
-m, --modified
-o, --others
-i, --ignored
-s, --stage
--directory
--no-empty-directory
-u, --unmerged
-k, --killed
-z
-x <pattern>, --exclude=<pattern>
-X <file>, --exclude-from=<file>
--exclude-per-directory=<file>
--exclude-standard
--error-unmatch
--with-tree=<tree-ish>
-t
H
S
M
R
C
K
?
-v
--full-name
--abbrev[=<n>]
--
<file>
OUTPUT¶
git ls-files just outputs the filenames unless --stage is specified in which case it outputs:
[<tag> ]<mode> <object> <stage> <file>
git ls-files --unmerged and git ls-files --stage can be used to examine detailed information on unmerged paths.
For an unmerged path, instead of recording a single mode/SHA1 pair, the index records up to three such pairs; one from tree O in stage 1, A in stage 2, and B in stage 3. This information can be used by the user (or the porcelain) to see what should eventually be recorded at the path. (see git-read-tree(1) for more information on state)
When -z option is not used, TAB, LF, and backslash characters in pathnames are represented as \t, \n, and \\, respectively.
EXCLUDE PATTERNS¶
git ls-files can use a list of "exclude patterns" when traversing the directory tree and finding files to show when the flags --others or --ignored are specified. gitignore(5) specifies the format of exclude patterns.
These exclude patterns come from these places, in order:
A pattern specified on the command line with --exclude or read from the file specified with --exclude-from is relative to the top of the directory tree. A pattern read from a file specified by --exclude-per-directory is relative to the directory that the pattern file appears in.
SEE ALSO¶
AUTHOR¶
Written by Linus Torvalds <torvalds@osdl.org[1]>
DOCUMENTATION¶
Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list <git@vger.kernel.org[2]>.
GIT¶
Part of the git(1) suite
NOTES¶
- 1.
- torvalds@osdl.org
- 2.
- git@vger.kernel.org
02/03/2020 | Git 1.7.1 |