Excluding files in git grep
source link: https://thewebivore.com/excluding-files-in-git-grep/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
I often use git grep to search around my files because I’m more used to it than other searching tools (such as regular grep) and it’s recently become more common for me to want to exclude a pattern from my search.
$ git grep FindThisThing ":(exclude)*_test.go"
The git grep command accepts a <pathspec> as an argument, and in order to exclude a pattern. Above, exclude is the “magic word” in the pathspec to say “ignore test files”.
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Post navigation
Recommend
-
11
Excluding Files from PWA Asset CacheSkip to main content Blazor - Excluding Files from PWA Asset Cache 24...
-
3
Copy batch files from the current directory, excluding advertisements I know i'm missing something really silly but would like some assistance...
-
5
Andrei F. on Twitter: "@Gok @jimmyjamesuk123 I get as much. This should be excluding *everything*; though it's still compiling files 🤡🤡 https://t.co/5eX2KazMil"Don’t miss what’s happeningPeople on Twitter are the first to know.
-
1
How to Exclude Unnecessary Files From Static Analysis? [Excluding Files] Few projects can do without outside libraries and other useful ready-made solutions. However, analyzers can see the whole code and check it with abandon....
-
2
Grep several patterns from a file and save them in different files advertisements Hi I have an mpd which has the following...
-
5
The GREP command - an overview The grep command, which stands for global regular expression print, is one of the most versatile commands in a Linux terminal environment. It is an extremely powerful program that allow...
-
3
How to find files in a directory using grep with wildcards? advertisements I have several hundred files with fi...
-
6
Linux: Find Files by Name & Grep Contents The Linux find command can be used for searching files and directories and performing subsequent operations on them. If you use the find...
-
5
Find text in files using the Linux grep command Using grep, you can quickly find text matching a regular expression in a single...
-
2
2022-10-12 — How I fixed git-grep macOS UTF-8 support As a speaker of Greek, I’ve been fixing issues in the handling of non-ASCII characters for over 40 years, u...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK