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.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
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:
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:
Call it with the usual required accompanying batch file:
gc-all-git.cmd:
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.
Please check your path to see if it matches in case.
is the same to windows as
But to Git they are in different locations. This is remedied by navigating back from the top with the proper casing.
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.
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.
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.