Skip to content

[Finder] Document recursive .gitignore files support #15866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions components/finder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,17 @@ default when looking for files and directories, but you can change this with the

$finder->ignoreVCS(false);

If the search directory contains a ``.gitignore`` file, you can reuse those
rules to exclude files and directories from the results with the
If the search directory and its subdirectories contain ``.gitignore`` files, you
can reuse those rules to exclude files and directories from the results with the
:method:`Symfony\\Component\\Finder\\Finder::ignoreVCSIgnored` method::

// excludes files/directories matching the .gitignore patterns
$finder->ignoreVCSIgnored(true);

.. versionadded:: 5.4

``.gitignore`` files recursive support was introduced in Symfony 5.4.

File Name
~~~~~~~~~

Expand Down