30

Windows search indexer is adding most paths to repository folders (both .git and .svn) to the exclusion list.

I can remove them manually of course, but each time i rebuild the index - they are re-added.

I can add them as indexed locations, but i'd have to do that each and every time I add a new repository and I add them in varying locations depending on relation.

Why is windows excluding these and how can i alter that behavior?

seems to have something to do with enter image description here

wonder how its identifying them as repositories. As repos from C:\user\dropbox\path\to\repo are excluded automatically, where items from c:\msys64\home\user are not. If i can understand what triggers it being identified as such, i can perhaps understand the difference and how to fix the behavior.

10
  • Your question rambles a bit, so I did not find it to be clear. (a) the search index is not static. It changes all the time. Once built (overnight on a big system), it does not use much CPU. (b) understand your file structure and point Index Location Options to what you want indexed and not what you do not want indexed. (c) the size of the index represents what you are indexing. Large indexes are normal. My index is 170,000 items and this does not present any issue
    – John
    Apr 11, 2020 at 11:47
  • Have you tried manually adding the parent directory containing the repos, or the repo directories themselves, to the search Indexer's list of directories to index (Indexing Options > Modify)?
    – JW0914
    Apr 11, 2020 at 11:56
  • 1
    If you don't need the full-text content search (just the file-name search) I would simply recommend to ignore the Windows search and use a well working tool like Search Everything instead.
    – Robert
    Apr 11, 2020 at 11:58
  • 1
    @Vimes about 60% the way down the page insider.windows.com/en-us/articles/desktop-search
    – klepp0906
    Nov 21, 2020 at 18:16
  • 2
    So this is why Windows Search has been completely worthless in opening my projects??? This is ridiculously stupid. I only found out about this while trying to disable Bing search in my search bar (I just want to search for folders on my machine...). Apr 27, 2022 at 23:17

3 Answers 3

8

It appears to be a "feature" like your screen shot shows. I suggest using the Windows Feedback app to report the problem, or up-voting this Windows Feedback item if that link works for you (might need to use a personal Microsoft account rather than a work/school one).

6
  • 1
    It says my account has no access to this feedback. Apr 28, 2021 at 20:15
  • 1
    I guess you'll have to leave a new feedback ticket. Not sure why the link failed (worked for my friend just now).
    – Vimes
    Apr 30, 2021 at 15:19
  • 2
    Had a coworker try the link and they got the error. Maybe it's a corporate vs personal account issue.
    – Vimes
    Apr 30, 2021 at 15:42
  • Now that you call it a "feature" I actually agree as I just realized GitHub and Bitbucket have a way to search all your code at once, so I don't actually need Windows search. Of course this isn't helpful if your repo is local only, or if your repo host doesn't have such a search feature. Nov 28, 2022 at 18:14
  • True. I usually use it to find project files I want to launch by name (project name+Enter).
    – Vimes
    Nov 29, 2022 at 19:48
4

I know this is a late answer to this, but I found a workaround. If you choose your folder (in my case, c:\code) and then go into each repo in the folder and exclude the hidden ".git" folder, the indexer seems to work.

1
  • 7
    Is it possible to just exclude all .git folders? Or better yet all dot folders in general? I don't understand why MS didn't do this and instead went the route of axing entire directories. Apr 13, 2022 at 3:04
0

On Win 10, I have found how to make the search feature work even for git repo folders. In my case, all the git initialized repo folders are in the C:\Users\USERNAME\Work\ folder. The whole User folder is checked for indexing in Indexing Options, and indexing this folder and its content automatically triggers the creation of the Excluded Folders rules for each repo in Windows Settings > Search > Searching Windows (ms-settings:cortana-windowssearch).

Workaround to be able to search:

  1. remove all thoses rules for the repos
  2. verify with regedit in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\WorkingSetRules\ that the rules for these repos have all been deleted
  3. exclude the folder C:\Users\USERNAME\Work by unchecking it (so that no further indexing is attempted, and so, preventing the creation of all those exclusion rules again)
  4. the folder still won't be indexed, but at least you can search in it (may be long though...)

I have seen a collegue with all his repos in a folder directly in C:\ (say C:\Work) an they were actually indexed! He was on Win 11, so it'd be great if someone with Win 11 could give his feedback on the subject :)

Of course I tried to replicate, but the repo was immediately excluded during indexing, as for my folder in C:\Users...

You must log in to answer this question.

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