Instead of using update-index to (un)track compiled assets, just .gitignore them; when it comes time to commit them, force-add them, commit, re-untrack them, and then squash the two commits into one.