Instead of removing an entry from the index and adding one with the same name, you can also directly update that entry!

Put the content you want in a file with a matching name, and then run

    $ git update-index <file>

This will create a new blob, and update the hash of the entry to that blob.

Update an entry in the index!