I have a file which I have marked assume-unchanged in my checkout. This is respected by most commands (e.g. diff
, add .
, commit -a
), but for some reason this command seems to be ignoring the flag:
git commit .
Is this a bug? If not, is there a flag to change git's behaviour in this case?
(My git version in 2.25.1, should that be important.)
The assume-unchanged flag to Git is used to improve performance on systems with slow
lstat(2)
calls. When you set this bit, you promise not to change the file at all. If you are changing the file, then you must unset the bit to notify Git that it's changed. This is a performance optimization only.If you are trying to ignore changes to tracked files, the Git FAQ is very clear that's not possible:
The FAQ recommends an approach for configuration files: