git stash leaving modified files? git stash leaving modified files? windows windows

git stash leaving modified files?


As DaveW said the problem comes from the core.fscache=true setting. This is a Windows only setting that enable a file system cache in order to mitigate slowness of some Windows file system operations. Here is the description extracted from the commit message Win32: add a cache below mingw's lstat and dirent implementations:

Checking the work tree status is quite slow on Windows, due to slow lstat emulation (git calls lstat once for each file in the index). Windows operating system APIs seem to be much better at scanning the status of entire directories than checking single files.

Add an lstat implementation that uses a cache for lstat data. Cache misses read the entire parent directory and add it to the cache. Subsequent lstat calls for the same directory are served directly from the cache.

Also implement opendir / readdir / closedir so that they create and use directory listings in the cache.

The cache doesn't track file system changes and doesn't plug into any modifying file APIs, so it has to be explicitly enabled for git functions that don't modify the working copy.

The last sentence of this commit message gives an indication of the cause of the OP problem.


At Ortomala Lokni's suggestion, I removed all global git config files 1.

The problem went away. I reinstated each file until the problem returned and then fiddled with settings that seemed like reasonable candidates.

The culprit was fscache - setting true causes the problem. I have no idea why as the same setting works fine on other PCs.

Thanks everyone for your help!