TortoiseGit 修改后的标志(图标覆盖)未更新

发布于 2024-12-15 12:27:09 字数 94 浏览 2 评论 0原文

我对一些代码做了一些小改动,但 TortoiseGit 将其显示为已修改(红色感叹号),尽管我已经提交、拉动、推送,但它仍然存在。我应该在这里做什么?我以前没有见过这个问题。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(19

舟遥客 2024-12-22 12:27:12

我也遇到了这个问题 - 结果是大写/小写问题。

我将 pickasset.designer.cs 更改为 pickasset.Designer.cs,叠加层现在可以正常工作。不知道它是如何首先设置为小写的。

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.

只为守护你 2024-12-22 12:27:12

就我而言,并不是 Tortoise 出现故障,而是默认情况下,TortoiseGit 不会将图标覆盖应用于其他位置,而是应用于固定驱动器。

我使用外部驱动器来存储所有源代码(每日备份),因此图标覆盖不起作用。我刚刚进入 TortoiseGit 设置,图标覆盖,标记了“删除驱动器”复选框,图标覆盖开始按预期工作。

TortoiseGit 图标叠加设置

在外部驱动器上工作的图标叠加

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.

TortoiseGit Icon Overlays settings

Icon overlays working on an external drive

瀞厅☆埖开 2024-12-22 12:27:11

这是 TortoiseGit 中的一个已知问题。它存在多年,显然永远不会被修复。不知道是不是TortoiseGit开发者不愿意或者做不到。 (我之前也报告过这个问题,但现在找不到这个问题了。)

无论如何,我是这样做来解决这个问题的:

git gc --prune=all --quiet

它会修剪 Git 存储库,重新打包所有这些单个对象文件,减少 中的文件数量>.git 从数万个减少到 20 以下,这可能会提高 Git 操作的整体性能。

有时,Git 在提交后会自行执行一个简单版本,但在多年的日常使用中我很少看到这种情况发生。所以我就自己做。这也是在进行系统备份之前需要考虑的一个很好的操作(见下文)。

为了方便起见,我在可访问的路径中创建了一个批处理文件 git-gcall.cmd ,该文件调用上面显示的命令。我几乎必须在每次提交后运行它,并且 2-3 秒后图标会自行更新。不涉及杀戮。只是唤醒 TortoiseGit 有点困难,以实际观察存储库并更新其状态。


下面是一个 PowerShell 脚本,它在一组配置的目录中递归运行此命令(如有必要),以便在进行备份之前使用。它也可以定期运行,例如夜间运行,以解决后台过时的图标问题。

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

使用通常所需的附带批处理文件调用它:

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%

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%
烟雨凡馨 2024-12-22 12:27:11

我认为这个问题发生在我身上是由于应用程序竞争 Windows 限制图标覆盖(我相信它最多允许 15 个)。

为了解决这个问题,我必须这样做:

  1. 打开regedit并浏览到Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers键。
  2. 通过添加空格前缀,重新排列子项,使 Tortoise* 键位于顶部。
  3. 使用任务管理器重新启动 Windows 资源管理器。

另请参阅:TortoiseGit 不显示图标叠加

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:

  1. Open regedit and browse to the Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers key.
  2. Rearrange the subkeys to that the Tortoise* keys were at the top by prefixing with spaces.
  3. Restart Windows Explorer using Task Manager.

See also: TortoiseGit not showing icon overlays

葬花如无物 2024-12-22 12:27:11

这里的其他选项都不能解决问题。 (我无法识别任何大小写发生变化的文件)
我非常有信心一切都已按应有的方式签入,因此我只是删除了我的存储库并再次签出。噗,又起作用了。

如果您不那么有信心(或者您只是不想冒险,这是最好的),请将您的存储库文件夹重命名为 lcoally 并再次检查您的存储库,然后您可以提取差异以查看是否缺少任何奇怪的内容/在两个存储库文件夹之间进行了更改。

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.

那小子欠揍 2024-12-22 12:27:11

为我们解决这个问题的方法是,我们已将 Git 存储库移至映射的网络驱动器,从而更改了驱动器号。

似乎需要将 TortoiseGit 设置为监视网络驱动器 - 这不是默认行为。

因此,要解决此问题,您可以:

  • 右键单击​​存储库文件夹
  • 选择“TortoiseGit”
  • 选择“设置”
  • 选择“图标覆盖”
  • 勾选“网络驱动器”

工作完成。

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.

格子衫的從容 2024-12-22 12:27:11

这可能会有所帮助...
我的驱动器盘符是 B: 并且覆盖图标不会更新。我将其更改为超越 C:,(我使用 M:)并且它开始工作。看起来 TGIT 不驱动低于 C:

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:

萌辣 2024-12-22 12:27:11

在对此感到惊讶并尝试了几乎所有方法之后,我设法通过简单地从标记为已修改的目录中删除一个文件来修复它,然后从 TortoiseGit 菜单本身恢复它。

PS 我确保整个目录的 CRC64 校验和在此操作之前和之后相同。

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.

初吻给了烟 2024-12-22 12:27:11

不确定这是否相关。

看起来 TortoiseGit 存在文件/文件夹案例的缓存问题。

就我而言,由于文件夹大小写与预期不正确,因此图标的叠加层未显示

< img src="https://i.sstatic.net/X1Zxu.png" alt="文件夹名称 zeta 中 Z 大小写的差异">

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

Difference of cases of Z in folder name zeta

请爱~陌生人 2024-12-22 12:27:11

就我而言,TortoiseGIT 表现正确,但 WindowsExplorer 欺骗了我。

我的文件夹中有一个未签入的文件 ~$Data.xls,因此 TortoiseGIT 在包含的文件夹上正确显示了红色图标:
输入图片描述在这里

但是,首先,我看不到这个文件,因此假设应该显示绿色图标。
该文件被 WinExplorer 隐藏,因为在其选项中勾选了“隐藏受保护的操作系统文件(推荐)”。
因此,我建议取消选中此选项以避免混淆:
输入图片此处描述

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:
enter image description here

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:
enter image description here

娇妻 2024-12-22 12:27:11

我遇到了一种情况,某些文件似乎不是存储库的一部分(这些文件上没有覆盖图标),而它们应该具有绿色复选标记覆盖。对我有用的是删除文件,然后使用 Git Revert 恢复文件。之后,这些文件就会带有绿色复选标记。

杀死 TGitCache.exe 不起作用,更改缓存设置也不起作用。

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.

自我难过 2024-12-22 12:27:10

我在 Windows 上也遇到了同样的问题。

杀死 TGitCache 确实有效了几秒钟,但红色图标再次出现。

结果发现该文件在本地被重命名(第一个字母从大写改为小写),但在 Git 中没有更改。 Windows 不区分大小写,但 Git 不区分大小写!所以图标叠加不再匹配。我确实通过删除特定文件并从 Turtoise Git 上下文菜单中选择“恢复”发现了这一点。在列表中,确实出现了两个文件,一个第一个字母大写,另一个完全小写。

最后从 Git 上下文菜单重命名文件确实解决了我的问题。

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.

晚风撩人 2024-12-22 12:27:10

请检查您的路径是否匹配。

Some/Dir/SomeFile.ext

对于 Windows 来说是相同的,

some/DIR/someFILE.EXT

但是对于 Git 来说它们位于不同的位置。通过使用适当的外壳从顶部导航回来可以解决此问题。

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.

夜清冷一曲。 2024-12-22 12:27:10

除了 @Andy 提到的之外,您还可以通过限制必须监视的文件夹来使覆盖更快地工作。

右键单击-> TortoiseGit->设置->图标叠加

此处输入包含和排除路径。我通常明确指向我的存储库/工作副本:

在此处输入图像描述

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:

enter image description here

ペ泪落弦音 2024-12-22 12:27:10

当图标未更新时,您可以使用以下“运行”命令快速终止图标覆盖缓存:

taskkill /f /im tgitcache.exe

缓存进程应自动重新启动。如果您发现它经常发生,您甚至可以将其变成桌面快捷方式。

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.

梦在深巷 2024-12-22 12:27:09

我假设你正在使用乌龟git?我以前遇到过这个问题,有时按 F5 可以修复它,有时它会在乌龟重新同步后消失。

这是另一个可能的修复链接

当前的解决方法是使用 Windows 任务管理器终止 TGitCache.exe。

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.

柠檬色的秋千 2024-12-22 12:27:09

对我有帮助的是:

  1. 转到“设置 -> 图标覆盖” 在“状态缓存”下检查选项“无”
  2. 刷新资源管理器 F5
  3. 返回并将缓存选项更改回“默认”

What helped for me was the following:

  1. Go to "Settings -> Icon Overlays" Check under "Status cache" the option "none"
  2. Refresh the explorer F5
  3. Go back and change the cache option back to "Default"
梦里的微风 2024-12-22 12:27:09

我尝试过一种解决方法:

重命名存储库的目录,然后将其改回来,就可以了!

例如:MyComplexProject 可以更改为 MyComplexProject1,然后再更改回 MyComplexProject

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.

灰色世界里的红玫瑰 2024-12-22 12:27:09

Kill TgitCache.exe 对我有用。 ....我将此作为答案,因为我没有足够的声誉点将其添加为评论。但希望帮助进一步重申它是一个可行的解决方案。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文