Git ls-files: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * Git Commands =Overview= Show information about files in the index and the working tree.") |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
=Overview= | =Overview= | ||
Show information about files in the index and the working tree. | Show information about files in the [[Git_Concepts#Index|index]] and the [[Git_Concepts#Working_Tree|working tree]]. | ||
=Options= | |||
==--exclude-standard== | |||
Do not show standard Git exclusions (.git/info/exclude, .gitignore in each directory, and the user's global exclusion file) in the output. | |||
==-c, --cached== | |||
Show cached files (default). | |||
==-o, --others== | |||
Show other (untracked) files. | |||
=Show Files that Have Been Modified in the Working Tree= | |||
git ls-files --modified | |||
The result of the command can be further filtered based on the values of [[Git_Concepts#Attributes|Git attributes]]. | |||
git ls-files --modified ':(attr:merge=ours)' | |||
=Show Files that Have Been Delete in the Working Tree= | |||
git ls-files --deleted | |||
=Show Untracked Files= | |||
git ls-files --others --exclude-standard | |||
([[#--exclude-standard|--exclude-standard]] is needed to drop ignored files from output) |
Latest revision as of 18:18, 25 February 2020
Internal
Overview
Show information about files in the index and the working tree.
Options
--exclude-standard
Do not show standard Git exclusions (.git/info/exclude, .gitignore in each directory, and the user's global exclusion file) in the output.
-c, --cached
Show cached files (default).
-o, --others
Show other (untracked) files.
Show Files that Have Been Modified in the Working Tree
git ls-files --modified
The result of the command can be further filtered based on the values of Git attributes.
git ls-files --modified ':(attr:merge=ours)'
Show Files that Have Been Delete in the Working Tree
git ls-files --deleted
Show Untracked Files
git ls-files --others --exclude-standard
(--exclude-standard is needed to drop ignored files from output)