How can I tell git to ignore the current modification made to a file foobar
, but not any future modifications?
I have in my worktree a file to which I made a small change that I do not want to commit back. I could use git update-index --assume-unchanged foobar
, but then git will ignore any other change made to this file.
I would like to tell git to ignore only the current modification to foobar
, and warn me if it has been changed in any other way.
So, considered that update-index --assume-unchanged
is not applicable in this case, is there another way to tell git to see foobar
as unchanged only as long as it has the current content or the current mtime
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…