I know how to use git update-index --assume-unchanged
on a file in a working directory.
My question is this: Is there any easy way to still check the difference of the file from, say, the version of that pointed to by the HEAD?
Right now I have to temporarily undo -assume-unchanged
before I can run git diff
. The sequence goes like this:
git update-index --no-assume-unchanged foo.java
git diff foo.java
git update-index --assume-unchanged foo.java
This works but it is kind of clumsy.
The file is tracked by git
but I need a locally modified version for my development environment. And I never want to commit the locally mofified version into git.
Updated
The question still applies even when I switch to use skip-worktree
instead
of assume-unchanged
. I have just learned that the former option
is a better one if the file is intended to be changed. See
this link for more information about the two options.