You know how to do it already. Yes, git add -f
is the way.
If you ask why… this is because git set a assume-unchanged
bit internally. This bit make git think the file is not modified, so git add
won’t add it.
If you want to mess with the implementation details, you can use git update-index --no-assume-unchanged <file>
command.