I have made a small change in some code but TortoiseGit shows it as modified (red exclamation sign) although I have committed, pulled, pushed, but it stays. What should I do here? I have not seen this issue before.
-
Take a diff of it, you should be able to see what changed. It can be also a TortoiseGit icon refresh issue – CharlesB Nov 15 '11 at 14:34
19 Answers
I'm assuming you are using tortoise git? I've had the issue before, sometimes pressing F5 fixes it other times it just goes away after tortoise resyncs itself.
Here is another possible fix link.
The current workaround is to kill TGitCache.exe with the Windows task manager.
-
1I think its tortoise - thanks I will try that. All i did was copy back a backfile file copy after I had made a mess of the code. – Booksman Nov 15 '11 at 14:37
-
1Make sure that you have actually committed the changes. You can see if the file has local modifications, which would cause the red exclamation, by right clicking->tortoiseGit->"Check For Modifications". – Andy Nov 15 '11 at 14:39
-
3Vote up for killing TGitCache.exe. In a few seconds it will start again automatically. – Sasha Dec 12 '14 at 07:23
-
64 years later, the problem still exists, and still no better workaround than killing TGitCache... the TortoiseGit team really needs to fix this one. Overlays are useless if they don't reflect the current state of the repo. – Thomas Levesque Oct 20 '15 at 14:57
-
1F5 did not resolve the issue, but killing TGitCache.exe fixed it for me. Upvoting! – Gabriel Hautclocq Oct 18 '16 at 08:57
-
16 years on and still the problem exists... though killing `TGitCache.exe` works... come on TortoiseGit devs .. fix this – exexzian Jul 30 '17 at 20:13
-
This is a silly solution, but it works ! (@Maxim do a sync or pull afterwards) – Thalia Oct 08 '18 at 15:07
-
1
-
What helped for me was the following:
- Go to "Settings -> Icon Overlays" Check under "Status cache" the option "none"
- Refresh the explorer F5
- Go back and change the cache option back to "Default"

- 41,995
- 13
- 95
- 133

- 652
- 5
- 11
-
4It does not work... it returns wrong status back when Default is selected... Update: it was necessary to "walk" through directory tree.. now it shows correct icons. – Maxim Mar 24 '17 at 18:14
There is a workaround that I have tried:
Rename the directory of the repository and then change it back and you are good to go!
As an example: MyComplexProject can be changed to MyComplexProject1 then back to MyComplexProject.

- 6,011
- 8
- 50
- 76
-
2
-
1This worked after killing the cache process failed; one file had been bugging me for months. – Erica Kane Mar 17 '17 at 16:05
-
This should be the accepted solution, since this actually forces TortoiseGit to clear the icon overlay cache. Killing the entire process seems like overkill. – Extragorey Dec 17 '18 at 23:35
-
-
Kill TGitCache.exe works for me. .... I put this as an answer because I don't have enough reputation points to add it as a comment. But wanted to help further iterate that it is a working solution.

- 342
- 1
- 3
- 14
-
1If this is a valid answer then there is no harm in putting it as an answer. Maybe you might want to provide a bit more detail on how this solves the problem though. – Kmeixner May 05 '15 at 20:44
-
This is the only thing that worked for me, but I don't know if it's safe to just kill TGitCache.exe. I seems safe, but maybe I'm just kicking the can down the road. – Lucas May 29 '15 at 08:48
-
I had the same issue at Windows.
Killing TGitCache did work for a couple of seconds but the red icon appeared again.
It turned out the file was renamed (first letter was changed from uppercase to lower case) locally but was not changed in Git. Windows is case insensitive but Git is! So the icon overlay did not match anymore. I did find this out by removing the specific file and selecting "revert" from the Turtoise Git context menu. In the list, two files did show up, one with first letter uppercase, the other complete lowercase.
Finally renaming the file from the Git context menu did resolve the issue for me.

- 193
- 1
- 12
-
4This thread started on Nov 15 '11. Today is Mar 27, 2018. Well, more than 6 years and there is no solution? C'mon Tortoise! – JohnCz Mar 27 '18 at 11:35
-
1in my case gitlab GUI showed two files with different cases. Removeng one of them in GUI, pulling changes, and reverting changes solved problem. – aleha_84 Feb 12 '19 at 09:58
-
1This was my problem. I changed the case of image extension in my project I just reverted back to old names. – TazAstroSpacial Jul 05 '19 at 07:47
-
1Perfect, thank you for your hint! When is this case-sensitive madness going to stop ;) – jaz Dec 08 '20 at 17:27
-
For anyone who would like to adjust the filename case, you can use `TortoiseGit > Rename...". If this option doesn't show, first delete the file and then revert it. – avgcoder Jan 08 '22 at 12:44
Please check your path to see if it matches in case.
Some/Dir/SomeFile.ext
is the same to windows as
some/DIR/someFILE.EXT
But to Git they are in different locations. This is remedied by navigating back from the top with the proper casing.

- 232,980
- 40
- 330
- 338

- 124,556
- 26
- 146
- 141
-
2In my case, a file called "resource.h" was renamed to "Resource.h" by Visual Studio. – kol Jul 14 '19 at 01:50
-
2
Apart from what @Andy mentioned, you can make the overlays work faster by limiting the folders that it has to monitor.
Right click-> TortoiseGit -> Settings -> Icon Overlays
Here enter include and exclude paths. I usually explicitly point to the my repos / working copies:

- 290,304
- 63
- 469
- 417
When the icons are not updating you can quickly kill the icon overlay cache using the following "Run" command:
taskkill /f /im tgitcache.exe
The cache process should restart itself automatically. You can even turn this into a desktop shortcut if you notice it happening frequently.

- 55,742
- 17
- 139
- 133
It's a known issue in TortoiseGit. It exists for years and will apparently never be fixed. I don't know whether it's because the TortoiseGit developer is unwilling or unable to do it. (I've also reported it before but can't find the issue anymore now.)
Anyway, here's what I do to resolve it:
git gc --prune=all --quiet
It prunes the Git repository, repacking all those single object files, reducing the number of files in .git
from up to tens of thousands to under 20, and probably improving the overall performance of Git operations.
Sometimes Git does a light version of that on its own after a commit, but I've rarely ever seen this happen in years of daily use. So I just do it myself. This is also a great action to consider before making a backup of the system (see below).
To make it easier, I've created a batch file git-gcall.cmd
in an accessible path that calls the command shown above. I have to run it after virtually every single commit and after 2–3 seconds the icons update themselves. No killing involved. Just waking up TortoiseGit a bit harder to actually observe the repository and update its status.
Here's a PowerShell script that runs this command in a set of configured directories recursively, if necessary, for use before making a backup. It can also be run on a regular basis, for example over night, to resolve this outdated icons issue in the background.
gc-all-git.ps1:
Write-Host "Packing Git repositories where necessary..."
function Git-Gc($path)
{
cd $path
Get-ChildItem . -Recurse -Hidden .git | Foreach-Object {
cd $_.FullName
if ((Get-ChildItem objects -File -Recurse).Count -gt 50)
{
cd ../
Write-Host $(Get-Location).Path
git gc --prune=all --quiet
}
}
}
Git-Gc C:\Source
Git-Gc C:\xampp\htdocs
Call it with the usual required accompanying batch file:
gc-all-git.cmd:
@echo off
cd /d "%~dp0"
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy unrestricted -File gc-all-git.ps1
exit /b %errorlevel%

- 18,655
- 23
- 113
- 210
I think this issue happened for me to due to applications competing for Windows limit icon overlays (I believe it allows a maximum of 15).
This is what I had to do to resolve this issue:
- Open
regedit
and browse to theComputer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers
key. - Rearrange the subkeys to that the Tortoise* keys were at the top by prefixing with spaces.
- Restart Windows Explorer using Task Manager.
See also: TortoiseGit not showing icon overlays

- 6,392
- 10
- 49
- 68
None of the other options here could make the problem go away. (I wasn't able to identify any file that had a change in casing) I was pretty confident that everything was checked in as it should be so I just deleted my repo and checked it out again. Poof, works again.
If you're not as confident (or you just don't want to risk it, as is best), rename your repo folder lcoally and check out your repo again, then you can pull a diff to see if anything odd is missing/changed between the two repo folders.

- 740
- 10
- 26
The thing that solved this issue for us was that we had moved our Git repos to a mapped network drive, thus changing the drive letter.
It seems that TortoiseGit needs to be set to monitor network drives - it is not the default behaviour.
So to solve this issue you would:
- Right click a repo folder
- Choose "TortoiseGit"
- Choose "Settings"
- Choose "Icon Overlays"
- Tick "Network drives"
Job done.

- 41
- 2
This might help... My drive letter was B: and the overlay icons would not update. I changed it to beyond C:, (I used M:) and it started working. Looks like TGIT does not drives below C:

- 23
- 1
- 7
-
There's a separate setting under icon overlays to include "Drives A: and B:" - those letters were always traditionally used for floppy disk drives. – PeterJ Dec 24 '18 at 02:37
After getting astonished by this and trying pretty much everything, I managed to get it fixed by simply deleting one single file from the directory marked as modified, then reverting it from the TortoiseGit menu itself.
P.S. I made sure the CRC64 checksum for the entire directory was identical before and after this operation.

- 7,807
- 7
- 51
- 95
Not sure if this is relevant.
Looks like TortoiseGit has cache issues with file/folder cases.
In my case since the folder case was not correct with the once expected, the icons' overlay were not showing up

- 17,954
- 24
- 89
- 100

- 11
- 3
In my case, TortoiseGIT behaved correctly, but WindowsExplorer tricked me.
There was a non-checked-in file in my folder, ~$Data.xls, thus TortoiseGIT correctly displayed the red icon on the containing folder:
However, in the first place, I could not see this file and thus assumed that the green icon should be displayed.
The file was hidden by WinExplorer because in its options "Hide protected operating system files (Recommended)" was ticked.
I thus recommend to untick this option to avoid confusion:

- 213
- 3
- 10
I encountered a case where some files appear to not be part of the repository (no overlay icon on those files) when they should have had the green checkmark overlay. The thing that worked for me was deleting the files, then using Git Revert to get the files back. Afterwards, the files had the green checkmark.
Killing TGitCache.exe didn't work for this, nor did changing the caching settings.

- 618
- 5
- 11
I had this problem also - it turned out to be the upper/lowercase issue.
I changed pickasset.designer.cs to pickasset.Designer.cs and the overlay now works correctly. Not sure how it got set to lowercase in the first place.

- 1
-
This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/33453340) – user12256545 Dec 21 '22 at 19:45
In my case was not some Tortoise malfunction but the fact that, by default, TortoiseGit doesn't apply icon overlays to other locations but fixed drives.
I use an external drive to store all my source code (daily backuped), so the icon overlay was not working. I just entered in TortoiseGit settings, Icon Overlays, marked the "Removal drives" checkbox and icon overlays started to work as expected.

- 352
- 2
- 7