Skip to content

Commit 76c268f

Browse files
author
Eric James Michael Ritz
committed
Describe how to list ignored files
This tip shows how to list all ignored files in a project, which will take into account not only any `.gitignore` file within a repository, but also any globally defined list of exclusions such as `/home/eric/.gitexcludes` and `.git/info/exclude` within the repository itself. Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
1 parent aa62766 commit 76c268f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes)
3737
* [Show all tracked files](https://github.com/git-tips/tips#show-all-tracked-files)
3838
* [Show all untracked files](https://github.com/git-tips/tips#show-all-untracked-files)
39+
* [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files)
3940

4041
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
4142
<!-- @doxie.inject end toc -->
@@ -239,5 +240,10 @@ git ls-files -t
239240
git ls-files --others
240241
```
241242

243+
## Show all ignored files
244+
```sh
245+
git ls-files --others -i --exclude-standard
246+
```
247+
242248
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
243249
<!-- @doxie.inject end -->

tips.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,9 @@
135135
{
136136
"title":"Show all untracked files",
137137
"tip":"git ls-files --others"
138+
},
139+
{
140+
"title": "Show all ignored files",
141+
"tip": "git ls-files --others -i --exclude-standard"
138142
}
139143
]

0 commit comments

Comments
 (0)