The .gitignore Superpower
The single most defining feature of fd—and the reason developers prefer it over find—is its native integration with version control semantics.
By default, fd automatically reads and respects .gitignore files.
The Problem with find
In modern development, a project folder might contain 100 source code files, but the node_modules, vendor, or .next directories might contain 500,000 files.
If you run find . -name "config.js", find will laboriously read all 500,000 files in node_modules before returning the result. To prevent this, you must construct a complex -prune command.
The fd Solution
If you run fd config.js in that same project folder, fd will check the .gitignore file. Seeing that node_modules is ignored, fd will instantly skip the entire directory tree.
The search finishes in 5 milliseconds instead of 5 seconds.
How fd Discovers Ignore Rules
fd traverses up the directory tree looking for ignore files. It respects:
.gitignore(in the current or parent directories).git/info/exclude(local repository exclusions)- The global gitignore file (configured via
core.excludesFilein~/.gitconfig) .fdignore(custom rules specifically forfd)
The .fdignore File
Sometimes you want fd to ignore a directory that Git is tracking, or vice versa.
If you place a .fdignore file in a directory, fd will parse it using the exact same syntax as .gitignore.
Example .fdignore:
# Ignore the large assets directory during searches,
# even though it is committed to git.
/assets/large_videos/
*.csv
Disabling Ignore Semantics (-I, --no-ignore)
There are times when you specifically need to search inside ignored directories (e.g., auditing an installed npm package inside node_modules).
To temporarily disable the .gitignore superpower, use the -I (capital i) flag.
# Search for a vulnerability inside ignored directories
fd -I "vulnerable_file"
Note: Even with -I, fd will still ignore hidden directories (like .git). To search absolutely everything, you must combine flags.