The man does not define 'hidden' and 'ignored'. This probably means the 'hidden' is a file starting with a dot and 'ignored' is an entry in related ignore lists (.gitignore and .ignore).
However it is not clear if 'hidden' also includes hidden dirs. For example, .config dir is ignored even with --hidden option, but is included with -u option.
What is the rule for hidden dirs, if any? Are all hidden dirs ignored without -u option?
Yes, hidden files mean dotfiles.
agby default ignores hidden files (i.e. dotfiles). This includes any hidden file or directory, we use the--hiddenargument to bypass that.From the man page,
Thus, it means any hidden file or directory (files within hidden directories in our case).
Using the unrestricted
-uargument makes it search everything: binary files, hidden files and even ignoring .ignores, .gitignore etc.This is the difference between them. I couldn't reproduce what you said:
Placing a file in the folder
.config/README.mdand searching using--hiddenyielded the result for me. One scenario where it could happen for you is if your.configdir is added to your.gitignorefile (a common setting) or any other ignore file. Thus-uwill always work.Further reading: