简体   繁体   中英

My git repository changes are constantly flagged as assume-unchanged

I've been using git on windows for years without any major issue. However, it's been some time now that I believe I have something that tempers with my local git repositories and from time to time flags my modified files as assume-unchanged to the point I have an alias that runs all my repo files and update-index --really-refresh --no-assume-unchanged each and every one of them, and I use it nearly before every git status . But this is no way to live: :P

I had removed ConEmu from my machine in hope this might help, but didn't get any results (mind, I should probably restart my machine before). I doubt VS code has anything to do with it. I'm at lost tbh. Is there any git config value that may cause this?

Has anyone experienced a similar issue and found the evil forces that are behind this Machiavellian mechanism? I wish to name and shame it throughout the universe...

Seriously though, any help would be highly appreciated.

From your comment: something (some script or some other process) is setting the assume-unchanged flag on each of your files.

You may look into your .git/hooks directory (also check git config core.hooksPath to see if you have a custom hooks directory configured), or some other script/task that would pass on all the files in your repo.

If you really don't have a clue about what might be causing this: use grep -e "assume-unchanged" -r. (to try to spot a script which would run update-index --assume-unchanged ), first in your repo, then in your home dir, in last resort from / ...

Ok, so after messing around with vs code, resharper and sublime text (uninstalling everything, deleting leftovers, restarting the machine and so on)- nothing was coming up as the reason behind this weird behaviour.

And then I commented out all of my gitconfig file- and the behaviour was gone. It then took me no time to figure out the reason behind this behaviour was the following configuration that was set to true:

core.ignoreStat

I have no idea how and when did it sneak into my gitconfig file and got set to true, but hopefully this will help others who may experience this.

I had a similar problem, but on Linux. The answer from OP about git config didn't work for me but got me looking in the right direction.

The git config option core.fsmonitor was set to true (carried over from my Windows config where this was an experimental option that improved performance). On my Linux system, this causes basically no file system changes to be detected by git. Now that I've removed it, everything works just fine.

Hope this helps someone else with the same issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM