2015-09-25 17 views

Trả lời

5

Hóa ra là ag tôn trọng nội dung của tệp .gitignore theo mặc định. Vì vậy, nếu node_modules nằm trong số .gitignore, ag sẽ không tìm kiếm. Đây là tất cả hành vi hợp lý, nhưng khó gỡ lỗi nếu bạn không mong đợi nó. Hy vọng bài viết này sẽ giúp bạn.

Có một bản tóm tắt tốt vào cuối man ag:

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. 

Đối với mục đích của tôi ag -t dường như làm việc tốt.

Các vấn đề liên quan