diff --git a/components/finder.rst b/components/finder.rst index 25cefdb2370..53da99bca7e 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -355,6 +355,15 @@ Restrict by a depth range by chaining calls or passing an array:: // same as above $finder->depth(['> 2', '< 5']); +Gitignore +~~~~~~~~~~~~~~~ + +The Finder can follow .gitignore file rules. :method:`Symfony\\Component\\Finder\\Finder::ignoreVCSIgnored`:: + + $finder->ignoreVCSIgnored(true); + +This will exclude files based on .gitignore rules as git does. + Custom Filtering ~~~~~~~~~~~~~~~~