2015-09-25 8 views
5

मैं एक गिट रेपो खोजने के लिए एजी का उपयोग कर रहा हूं। यह मेरे node_modules उपनिर्देशिका के अंतर्गत मिलान नहीं पाता है। क्यों नहीं, और मैं इस व्यवहार को कैसे नियंत्रित कर सकता हूं?मैं node_modules में मैचों को खोजने के लिए एजी को कैसे मजबूर कर सकता हूं?

उत्तर

5

यह पता चला है कि एजी डिफ़ॉल्ट रूप से .gitignore फ़ाइल की सामग्री का सम्मान करता है। तो यदि node_modules.gitignore में है, तो एजी इसे खोज नहीं पाएगा। यह सभी समझदार व्यवहार है, लेकिन यदि आप इसकी अपेक्षा नहीं कर रहे हैं तो डीबग करना मुश्किल है। उम्मीद है कि यह पोस्ट मदद करेगा।

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. 

मेरी प्रयोजनों ag -t के लिए अच्छी तरह से काम करने लगता है।

संबंधित मुद्दे

 संबंधित मुद्दे