0

How do I tell Window File Explorer that I don't want to see anything inside dot-folders in my search results?

I have a bunch of version-controlled working folders, each of which contains a repository -- the repository is a ".hg" or ".git" sub-folder.

I usually only want to find the latest version of those files or folders in the working folder. I practically never want any of the dozens of older versions inside the repository -- inside the ".hg" or ".git" sub-folder.

I have a laptop running Windows 10 Home. I often use the Windows File Explorer "search in this folder" field (on the right side, near the top of the Windows File Explorer window) to find files or subfolders. (For example, I'm searching for a "todo.txt" file, or I'm searching for all the "*.py" files that contain a "FIXME" comment).

Currently those searches often give me a long list of files or folders or both, some of them the latest version in the working folder (which are the ones I want to edit). But the search results also list older versions of those files that are inside the ".hg" or ".git" folder. I've been repeatedly told "Never directly edit stuff inside the repository dot-folder", but it's all to easy to accidentally select the wrong one from the search results, since they all have exactly the same name as the one I really wanted to edit.

(Ideally I want an answer that excludes only everything inside specific ".hg" and ".git" folders; but an answer that excludes everything that starts with a dot might also be useful).

(If I ever did want to find those dot-folders or dot-folders, I could use Using Windows Explorer, how to find file names starting with a dot (period), in 7 or Vista? ).

(This is almost the same question as https://stackoverflow.com/questions/23693087/how-to-matchunmatch-repositories-in-folder-with-find except for Windows instead of Linux/Unix).

1 Answer 1

0

Add the following to your search criteria:

FolderName:NOT .hg FolderName:NOT .git

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .