-->

TortoiseGit not showing icon overlays

2019-03-07 13:36发布

问题:

I have been using TortoiseGit for almost a full year now. It has been working very well for me until yesterday, when I encountered a problem. I was deleting a folder when Windows Explorer sort of crashed on me (it hung on "discovering items") for over an hour, then I restarted the system.

Since that time (and I am not sure if the incident described has anything to do with it), TortoiseGit has stopped showing icon overlays in explorer. The behaviour is, however, not like any of the others who posted questions here, because:

In the open file dialogue of all programs, the icons still exist (!).

Here is a list of things I tried:

  1. I changed TortoiseGit settings to show different icons.
  2. Reinstall TortoiseGit (uninstall, restart, install, restart).
  3. I deleted all icon overlays starting with "Tortoise" in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer \ShellIconOverlayIdentifiers, then uninstalled TortoiseGit, restarted the computer and reinstalled TortoiseGit.

Edit:

I tried to create a new user on my computer, and the new user has icon overlays working just fine. I am now even more confused.

Nothing helped so far. Any ideas?

回答1:

I had the same problem and I got it to work by following instructions from a forum. What I did was this (copied):

I find solution :) Wrapping with "" all tortoise keys under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers

on 1TortoiseNormal and etc... I understood the problem, seeing as Dropbox and it worked regedit there was the sign ("") to Dropbox but not tortoise. So I added the signs, close explorer.exe and hop it was good :)

So what I did was rename the key 1TortioiseNormal to "1TortioiseNormal" etc. I have no idea why wrapping it inside a double quote makes it work again.

The original forum is gone, but a good summary is supplied in the comments.



回答2:

Windows will only allow up to 11 icon overlay identifiers, arranged in alphanumeric order - if there are more than 11, these icons will not be displayed.

You can run the following command in a DOS prompt:

regedit /e c:\icons.txt HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers

Then open the file C:\icons.txt. Skip the first two lines, and if 1TortoiseNormal and the other *Tortoise* values are not in the top 11 values, their icon overlays will not be shown. The solution provided by @Chi Chan is just a simple way to make 1TortoiseNormal rank higher when ordered among all the overlays, you can also rename the values by adding space(s) before 1TortoiseNormal, i.e.,

" 1TortoiseNormal"

to make them rank higher.

update: for Windows 8, the limit of icon overlays is 15.



回答3:

Windows 10 Solution Steps;

  1. Open regedit

Path :

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers

  1. Remove/delete all SkyDrive/OneDrive keys. You may need to take ownership of the keys one by one and give your user full control if you receive an error while trying to delete the keys.

  2. Press Ctrl+Shift+Esc and restart "Windows Explorer" (Optionally restart computer)

  3. All git/svn overlay icons are now visible !



回答4:

Before going nuts, just try rebooting! It worked for me ;)



回答5:

Just add one Space(or more if needed) to first Name of Tortoise options to this regedit addersses:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers

for example:

"1TortoiseNormal"

Should change to:

" 1TortoiseNormal"

after a system reboot icons shows currectly.



回答6:

I had this same problem today after uninstalling TortoiseSVN. I rebooted and still no luck so I just went into Control Panel, Uninstall a Program and on the TortoiseGit item I picked 'Repair' and everything is back to normal. I suspect that all of the Tortoise line of apps have some shared registry keys or something.



回答7:

I also had my TortoiseGIT shell icons quit displaying suddenly, I don't remember exactly what led up to it but I found this and tried the registry stuff changing 1TortioiseNormal to "1TortioiseNormal" and so on. That is probably a good thing to do no matter what but icon overlays were still not working.

I am too busy for the blanket answer of "restart the computer" what that says to me is "some service process needs to be restarted but you'd never be able to find it so just restart." Nah.

I also use TortoiseSVN and those icon overlays were still working for me. I looked in my processes tab of task manager and saw I had something called TSVNCache.exe running. No sign of anything similar for git, so on a whim I went over to the applications tab and hit "New Task", entered TGITCache.exe and sure enough that process fired up. From there go back to processes, kill explorer.exe, then go back to applications -> New Task again and fire up explorer.exe.

This has worked for me twice now when my TortoiseGIT icon overlays have quit, so, maybe it will work for someone else.



回答8:

I had installed TortoiseSVN (1.9.5) and msysgit (2.11.0) first on my Windows 10 64-bit machine. TortoiseSVN icons displayed fine.

When I installed TortoiseGit (2.3.0.0) after these two the icons wouldn't display.

I checked HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers and all looked fine. The tortoise icons were in the top 10.

What I used to fix was raised in TortoiseGit issue #692 on GitLab:

  • Open regedit.exe
    • Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer
    • Add a new string value "Max Cached Icons" with value "2000"

closed/restarted explorer and icons display!



回答9:

What worked for me was to uninstall Google Drive from my computer. Not sure why yet.



回答10:

The problem with the leading spaces is that every time you reboot, Dropbox adds another space to its registries, and will be always one step ahead of you.

So I've scheduled a python script found on this post (by Christoph Zwerschke) to execute every time the computer boots. You also have to restart the Explorer after that.

The .bat will look like:

python iconOverlayFixer.py
taskkill /f /im explorer.exe 
start explorer.exe  

And the python script:

#/usr/bin/python3

import os
import winreg as reg

# names of all overlay icons that shall be boosted:

boost = """
    Tortoise1Normal
    Tortoise2Modified
    Tortoise3Conflict
    Tortoise4Locked
    Tortoise5ReadOnly
    Tortoise6Deleted
    Tortoise7Added
    Tortoise8Ignored
    Tortoise9Unversioned
"""

boost = set(boost.split())

with reg.OpenKey(reg.HKEY_LOCAL_MACHINE,
        r'SOFTWARE\Microsoft\Windows\CurrentVersion'
        r'\Explorer\ShellIconOverlayIdentifiers') as base:

    names = set()
    renames = []
    i = 0
    while True:
        try:
            name = reg.EnumKey(base, i)
        except OSError:
            break
        core = name.strip()
        if core in names:
            print('Delete', repr(core))
            reg.DeleteKey(base, name)
        else:
            names.add(core)
            if core in boost:
                core = ' ' + core
            if core != name:
                renames.append((name, core))
        i += 1

    if renames:
        for old_name, new_name in renames:
            print('Rename', repr(old_name), 'to', repr(new_name))
            value = reg.QueryValue(base, old_name)
            reg.CreateKey(base, new_name)
            reg.SetValue(base, new_name, reg.REG_SZ, value)
            reg.DeleteKey(base, old_name)
    else:
        print('Nothing to rename')


回答11:

What is worked for me for Windows 10 is

  1. uninstalling TortoiseGit
  2. cleaning folders and register
  3. installing it once again
  4. rebooting the computer
  5. making random commit even not seeing the red icon


回答12:

I Agree with Chi Chan and I would like to add this as an complementary answer.

It's Dropbox Explorer icons. Here is a registry script to remove them. Save it somewhere, because they will come back!

Note, that the values change from time to time, too. Currently they have 3 spaces before the "DropboxExtXX", before they had only one.

Remove Dropbox Explorer Icons.reg

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt01]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt02]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt03]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt04]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt05]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt06]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt07]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt08]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt09]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\   DropboxExt10]


回答13:

Well, I suppose I missed the obvious step...

In TortoiseGit Settings > Icon Overlays:

Make sure to add your projects folder to the "Include Paths" box.