Why doesn’t git recognize that my file has been changed, therefore git add not working

I had a problem where once upon a time I set the git index to ‘assume unchanged’ on my file.

You can tell git to stop ignoring changes to the file with:

git update-index --no-assume-unchanged path/to/file

If that doesn’t help a reset may be enough for other weird cases.


In practice I found removing the cached file and resetting it to work:

git rm --cached path/to/file
git reset path/to/file

The git rm --cached means to only remove the file from the index, and reset tells git to reload the git index from the last commit.

Leave a Comment