Is there a variation on git update-index --skip-worktree
that will make the file be treated as unchanged but only until the next time the file is modified?
In other words, I'm looking for a self-cancelling --skip-worktree
equivalent.
My motivation is that I've made some changes that I don't want ever to commit. But if I ever make any further changes to the same file I want it immediately to reappear in the list of modified files so that I am prompted to consider if the new changes should be committed. If I use git update-index --skip-worktree
then I am likely to forget.
(There are lots of similar questions and answers but none of them describe a 'self-cancelling' method, e.g. https://stackoverflow.com/a/3320183/127670.)