--gitignore / --no-gitignore¶
The --gitignore
flag makes show-file-tree respect .gitignore
files, excluding ignored files and folders from the tree.
The --no-gitignore
flag ignores .gitignore
, showing all files and folders.
Usage¶
Respect .gitignore
(default)¶
Only files not listed in .gitignore
appear.
Ignore .gitignore
¶
All files are displayed, even if ignored in Git.
Example¶
.gitignore
contents:¶
With --gitignore
¶
Ignored: __pycache__/
, .env
, .log
files.
With --no-gitignore
¶
Tips¶
- Useful in CI pipelines where you want a complete file tree.
- Combine with
--hidden
to show hidden files that are also ignored by Git. - Combine with
--format md
for full documentation including ignored files: