38

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

I wonder how it's 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.

klepp0906
  • 1,175

3 Answers3

9

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.

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).

Vimes
  • 472
3

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...

hymced
  • 174