Listing files in Git
Exploring git ls-files
This post describes, my experiments with git ls-files command.
In repository, we have files:
1 | .DS_Store (Mac OS X, folder settings file) |
This command show us, all committed files and staged files.
1 | $ git ls-files |
This command show us, all files that are ignored or untracked. Those files are called ‘other’.
1 | $ git ls-files --others |
This command show us, all others files, without ignored files. Option exclude-standard means that standard git exclusion files are included.
1 | $ git ls-files --others --exclude-standard |
This command show us, all files that are ignored.
1 | $ git ls-files --ignored --others --exclude-standard |
In my global git ignore file, there is a rule to ignore all .DS_Store files. In my local git ignore file, there is a rule to ignore ignoredFile file.