diff --git a/components/finder.rst b/components/finder.rst index eac3e20d8da..c0cecfa0032 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -148,6 +148,14 @@ can reuse those rules to exclude files and directories from the results with the // excludes files/directories matching the .gitignore patterns $finder->ignoreVCSIgnored(true); +Rules from higher levels will be overridden by those in lower levels. + +.. note:: + + Only ``.gitignore`` files from search directories and their descendants are + read. Files from parent directories are ignored. To be consistent with Git + behavior, you should explicitly search from the Git repository root. + .. versionadded:: 5.4 ``.gitignore`` files recursive support was introduced in Symfony 5.4.