5
私はgit repoを検索するためにagを使用しています。私のnode_modules
サブディレクトリの下で一致するものは見つかりません。なぜ、どうしたらこの動作を制御できますか?どのようにしてagにnode_modulesでの一致を見つけることができますか?
私はgit repoを検索するためにagを使用しています。私のnode_modules
サブディレクトリの下で一致するものは見つかりません。なぜ、どうしたらこの動作を制御できますか?どのようにしてagにnode_modulesでの一致を見つけることができますか?
デフォルトでは、.gitignore
ファイルの内容にagが使用されていることが判明しました。したがって、node_modules
が.gitignore
にある場合、agはそれを検索しません。これはすべて賢明な動作ですが、期待していなければデバッグするのは難しいです。うまくいけば、この投稿は役に立ちます。
man ag
の最後に良い要約があります:私の目的のためにag -t
IGNORING FILES
By default, ag will ignore files whose names match patterns in .gitig-
nore, .hgignore, or .agignore. These files can be anywhere in the
directories being searched. Ag also ignores files matched by the
svn:ignore property if svn --version is 1.6 or older. Finally, ag looks
in $HOME/.agignore for ignore patterns. Binary files are ignored by
default as well.
If you want to ignore .gitignore, .hgignore, and svn:ignore, but still
take .agignore into account, use -U.
Use the -t option to search all text files; -a to search all files; and
-u to search all, including hidden files.
はうまく動作するようです。