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

1

6

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*
Epiphenomenon answered 1/1, 2018 at 9:30 Comment(0)
E
11

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.

Engrossing answered 1/1, 2018 at 13:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.