WebQube
WebQube

Reputation: 8981

Silver Searcher: how to unignore files in the .gitignore?

I have a folder of aliases. These are bash files. Some are sensitive, so I keep them in a .gitignore.

~/.bash_utilities
   bash_a.sh
   bash_b.sh
   .gitignore

.gitignore: bash_b.sh

The problem is that my Silver Searcher looks at the .gitignore and skips those files when looking. How do I tell Silver Searcher to ignore the .gitignore file and look in all the files in the directory?

My current command is

ag $1 ~/.bash*

Upvotes: 6

Views: 1286

Answers (1)

Arkadiusz Drabczyk
Arkadiusz Drabczyk

Reputation: 12528

IIUC, it's well explained in man ag:

-u --unrestricted

Search all files. This ignores .ignore, .gitignore, etc. It searches binary and hidden files as well.

-U --skip-vcs-ignores

Ignore VCS ignore files (.gitignore, .hgignore), but still use .ignore.

Upvotes: 12

Related Questions