10

Excluding files in git grep

 3 years ago
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.
Excluding files in git grep
Internet-ivore, development-ivore, design-ivore, event-ivore, fun-ivore. Technology, fun, and Philadelphia.

Skip to content

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”.

Posted in: Blog

Tags:git go golang

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

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK