TOOL » GIT

Ls files

Usage

Show information about files in the index and the working tree.

shell
git ls-files OPTIONS FILE
OptionDescription
--error-unmatchIf any FILE does not appear in the index, treat this as an error (return 1).

Example

Check if a file is being tracked by git.

shell
git ls-files --error-unmatch src/file.txt