Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linux

bash

ack

ag

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*
like image 277
WebQube Avatar asked Jan 04 '23 00:01

WebQube


1 Answers

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.

like image 180
Arkadiusz Drabczyk Avatar answered Jan 05 '23 12:01

Arkadiusz Drabczyk